Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

feat: pinned projects

Blue Moused9b1915e343a
diff --git a/backend/apps/cloud/src/project/entity/index.ts b/backend/apps/cloud/src/project/entity/index.ts
index 2f08fc0be..ddcfb3992 100644
--- a/backend/apps/cloud/src/project/entity/index.ts
+++ b/backend/apps/cloud/src/project/entity/index.ts
@@ -3,3 +3,4 @@ export * from './funnel.entity'
export * from './project.entity'
export * from './project-share.entity'
export * from './annotation.entity'
+export * from './pinned-project.entity'
diff --git a/backend/apps/cloud/src/project/entity/pinned-project.entity.ts b/backend/apps/cloud/src/project/entity/pinned-project.entity.ts
new file mode 100644
index 000000000..a6a72c949
--- /dev/null
+++ b/backend/apps/cloud/src/project/entity/pinned-project.entity.ts
@@ -0,0 +1,33 @@
+import {
+ Entity,
+ Column,
+ PrimaryGeneratedColumn,
+ ManyToOne,
+ JoinColumn,
+ Unique,
+} from 'typeorm'
+import { ApiProperty } from '@nestjs/swagger'
+
+import { User } from '../../user/entities/user.entity'
+import { Project } from './project.entity'
+
+@Entity()
+@Unique(['user', 'project'])
+export class PinnedProject {
+ @ApiProperty()
+ @PrimaryGeneratedColumn('uuid')
+ id: string
+
+ @ApiProperty({ type: () => User })
+ @ManyToOne(() => User, { onDelete: 'CASCADE' })
+ @JoinColumn({ name: 'userId' })
+ user: User
+
+ @ApiProperty({ type: () => Project })
+ @ManyToOne(() => Project, { onDelete: 'CASCADE' })
+ @JoinColumn({ name: 'projectId' })
+ project: Project
+
+ @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
+ created: Date
+}
diff --git a/backend/apps/cloud/src/project/project.controller.ts b/backend/apps/cloud/src/project/project.controller.ts
index 8afca86ac..e7c546f8b 100644
--- a/backend/apps/cloud/src/project/project.controller.ts
+++ b/backend/apps/cloud/src/project/project.controller.ts
@@ -274,6 +274,50 @@ export class ProjectController {
return paginated
}
+ @ApiBearerAuth()
+ @Post('/:id/pin')
+ @ApiOperation({ summary: 'Pin a project to the top of the dashboard' })
+ @ApiResponse({ status: 200, description: 'Project pinned successfully' })
+ @Auth(true)
+ async pinProject(
+ @Param('id') projectId: string,
+ @CurrentUserId() userId: string,
+ ): Promise<void> {
+ this.logger.log({ projectId, userId }, 'POST /project/:id/pin')
+
+ if (!isValidPID(projectId)) {
+ throw new BadRequestException('The provided project ID is incorrect')
+ }
+
+ const project = await this.projectService.getFullProject(projectId, userId)
+
+ if (!project) {
+ throw new NotFoundException('Project not found')
+ }
+
+ this.projectService.allowedToView(project, userId)
+
+ await this.projectService.pinProject(userId, projectId)
+ }
+
+ @ApiBearerAuth()
+ @Delete('/:id/pin')
+ @ApiOperation({ summary: 'Unpin a project from the top of the dashboard' })
+ @ApiResponse({ status: 200, description: 'Project unpinned successfully' })
+ @Auth(true)
+ async unpinProject(
+ @Param('id') projectId: string,
+ @CurrentUserId() userId: string,
+ ): Promise<void> {
+ this.logger.log({ projectId, userId }, 'DELETE /project/:id/pin')
+
+ if (!isValidPID(projectId)) {
+ throw new BadRequestException('The provided project ID is incorrect')
+ }
+
+ await this.projectService.unpinProject(userId, projectId)
+ }
+
@ApiBearerAuth()
@Post('/')
@ApiResponse({ status: 201, type: Project })
diff --git a/backend/apps/cloud/src/project/project.module.ts b/backend/apps/cloud/src/project/project.module.ts
index c850ce176..3ef49fd2b 100644
--- a/backend/apps/cloud/src/project/project.module.ts
+++ b/backend/apps/cloud/src/project/project.module.ts
@@ -15,6 +15,7 @@ import {
Funnel,
ProjectShare,
Annotation,
+ PinnedProject,
} from './entity'
import { ProjectsViewsRepository } from './repositories/projects-views.repository'
import { ProjectViewEntity } from './entity/project-view.entity'
@@ -32,6 +33,7 @@ import { ProjectExtraService } from './project-extra.service'
Annotation,
ProjectViewEntity,
ProjectViewCustomEventEntity,
+ PinnedProject,
]),
forwardRef(() => UserModule),
forwardRef(() => OrganisationModule),
diff --git a/backend/apps/cloud/src/project/project.service.ts b/backend/apps/cloud/src/project/project.service.ts
index b628c579d..1ebd1a764 100644
--- a/backend/apps/cloud/src/project/project.service.ts
+++ b/backend/apps/cloud/src/project/project.service.ts
@@ -64,7 +64,7 @@ import {
} from '../common/constants'
import { clickhouse } from '../common/integrations/clickhouse'
import { IUsageInfoRedis } from '../user/interfaces'
-import { ProjectSubscriber, Funnel, Annotation } from './entity'
+import { ProjectSubscriber, Funnel, Annotation, PinnedProject } from './entity'
import { AddSubscriberType } from './types'
import {
CreateProjectDTO,
@@ -292,6 +292,8 @@ export class ProjectService {
private readonly funnelRepository: Repository<Funnel>,
@InjectRepository(Annotation)
private readonly annotationRepository: Repository<Annotation>,
+ @InjectRepository(PinnedProject)
+ private readonly pinnedProjectRepository: Repository<PinnedProject>,
private readonly actionTokens: ActionTokensService,
private readonly mailerService: MailerService,
private readonly userService: UserService,
@@ -1655,6 +1657,8 @@ export class ProjectService {
_map(paginated.results, ({ id }) => id),
)
+ const pinnedProjectIds = await this.getPinnedProjectIds(userId)
+
paginated.results = _map(paginated.results, project => {
const userShare = project.share?.find(share => share.user?.id === userId)
const organisationMembership = project.organisation?.members?.find(
@@ -1681,12 +1685,71 @@ export class ProjectService {
isDataExists: _includes(pidsWithData, project?.id),
isErrorDataExists: _includes(pidsWithErrorData, project?.id),
organisationId: project?.organisation?.id,
+ isPinned: _includes(pinnedProjectIds, project?.id),
role,
passwordHash: undefined,
admin: undefined,
}
})
+ // Sort pinned projects first
+ paginated.results.sort((a: any, b: any) => {
+ if (a.isPinned && !b.isPinned) return -1
+ if (!a.isPinned && b.isPinned) return 1
+ return 0
+ })
+
return paginated
}
+
+ async getPinnedProjectIds(userId: string): Promise<string[]> {
+ const pinnedProjects = await this.pinnedProjectRepository.find({
+ where: { user: { id: userId } },
+ relations: ['project'],
+ select: {
+ project: {
+ id: true,
+ },
+ },
+ })
+
+ return _map(pinnedProjects, pp => pp.project?.id).filter(Boolean)
+ }
+
+ async pinProject(userId: string, projectId: string): Promise<void> {
+ // Check if already pinned
+ const existing = await this.pinnedProjectRepository.findOne({
+ where: {
+ user: { id: userId },
+ project: { id: projectId },
+ },
+ })
+
+ if (existing) {
+ return // Already pinned
+ }
+
+ await this.pinnedProjectRepository.save({
+ user: { id: userId },
+ project: { id: projectId },
+ })
+ }
+
+ async unpinProject(userId: string, projectId: string): Promise<void> {
+ await this.pinnedProjectRepository.delete({
+ user: { id: userId },
+ project: { id: projectId },
+ })
+ }
+
+ async isProjectPinned(userId: string, projectId: string): Promise<boolean> {
+ const pinned = await this.pinnedProjectRepository.findOne({
+ where: {
+ user: { id: userId },
+ project: { id: projectId },
+ },
+ })
+
+ return !!pinned
+ }
}
diff --git a/backend/apps/community/src/common/utils.ts b/backend/apps/community/src/common/utils.ts
index d9a34ba2f..a0033c190 100644
--- a/backend/apps/community/src/common/utils.ts
+++ b/backend/apps/community/src/common/utils.ts
@@ -1161,6 +1161,71 @@ const sumArrays = (source: number[], target: number[]) => {
return result
}
+// Pinned projects functions
+const getPinnedProjectsClickhouse = async (
+ visitorId: string,
+): Promise<string[]> => {
+ const query = `SELECT projectId FROM pinned_project WHERE visitorId = {visitorId:String};`
+
+ const { data } = await clickhouse
+ .query({
+ query,
+ query_params: { visitorId },
+ })
+ .then(resultSet => resultSet.json<{ projectId: string }>())
+
+ return _map(data, row => row.projectId)
+}
+
+const pinProjectClickhouse = async (
+ visitorId: string,
+ projectId: string,
+): Promise<void> => {
+ const id = crypto.randomUUID()
+ const now = dayjs.utc().format('YYYY-MM-DD HH:mm:ss')
+
+ await clickhouse.insert({
+ table: 'pinned_project',
+ format: 'JSONEachRow',
+ values: [
+ {
+ id,
+ visitorId,
+ projectId,
+ created: now,
+ },
+ ],
+ })
+}
+
+const unpinProjectClickhouse = async (
+ visitorId: string,
+ projectId: string,
+): Promise<void> => {
+ const query = `ALTER TABLE pinned_project DELETE WHERE visitorId = {visitorId:String} AND projectId = {projectId:FixedString(12)};`
+
+ await clickhouse.command({
+ query,
+ query_params: { visitorId, projectId },
+ })
+}
+
+const isProjectPinnedClickhouse = async (
+ visitorId: string,
+ projectId: string,
+): Promise<boolean> => {
+ const query = `SELECT 1 FROM pinned_project WHERE visitorId = {visitorId:String} AND projectId = {projectId:FixedString(12)} LIMIT 1;`
+
+ const { data } = await clickhouse
+ .query({
+ query,
+ query_params: { visitorId, projectId },
+ })
+ .then(resultSet => resultSet.json())
+
+ return !_isEmpty(data)
+}
+
export {
checkRateLimit,
createProjectClickhouse,
@@ -1205,4 +1270,9 @@ export {
createAnnotationClickhouse,
updateAnnotationClickhouse,
deleteAnnotationClickhouse,
+ // pinned projects
+ getPinnedProjectsClickhouse,
+ pinProjectClickhouse,
+ unpinProjectClickhouse,
+ isProjectPinnedClickhouse,
}
diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.ts
index 6c01af25e..297578011 100644
--- a/backend/apps/community/src/project/project.controller.ts
+++ b/backend/apps/community/src/project/project.controller.ts
@@ -97,6 +97,9 @@ import {
createAnnotationClickhouse,
updateAnnotationClickhouse,
deleteAnnotationClickhouse,
+ getPinnedProjectsClickhouse,
+ pinProjectClickhouse,
+ unpinProjectClickhouse,
} from '../common/utils'
import { Funnel } from './entity/funnel.entity'
import { ProjectViewEntity } from './entity/project-view.entity'
@@ -290,13 +293,73 @@ export class ProjectController {
}
})
+ // Get pinned projects
+ const pinnedProjectIds = await getPinnedProjectsClickhouse(userId)
+
+ // Add isPinned flag to results
+ const resultsWithPinned = _map(results, project => ({
+ ...project,
+ isPinned: _includes(pinnedProjectIds, project?.id),
+ }))
+
+ // Sort pinned projects first
+ resultsWithPinned.sort((a: any, b: any) => {
+ if (a.isPinned && !b.isPinned) return -1
+ if (!a.isPinned && b.isPinned) return 1
+ return 0
+ })
+
return {
- results,
+ results: resultsWithPinned,
page_total: _size(combinedProjects),
total: _size(combinedProjects),
}
}
+ @ApiBearerAuth()
+ @Post('/:id/pin')
+ @ApiOperation({ summary: 'Pin a project to the top of the dashboard' })
+ @ApiResponse({ status: 200, description: 'Project pinned successfully' })
+ @Auth(true)
+ async pinProject(
+ @Param('id') projectId: string,
+ @CurrentUserId() userId: string,
+ ): Promise<void> {
+ this.logger.log({ projectId, userId }, 'POST /project/:id/pin')
+
+ if (!isValidPID(projectId)) {
+ throw new BadRequestException('The provided project ID is incorrect')
+ }
+
+ const project = await this.projectService.getFullProject(projectId)
+
+ if (!project) {
+ throw new NotFoundException('Project not found')
+ }
+
+ this.projectService.allowedToView(project, userId)
+
+ await pinProjectClickhouse(userId, projectId)
+ }
+
+ @ApiBearerAuth()
+ @Delete('/:id/pin')
+ @ApiOperation({ summary: 'Unpin a project from the top of the dashboard' })
+ @ApiResponse({ status: 200, description: 'Project unpinned successfully' })
+ @Auth(true)
+ async unpinProject(
+ @Param('id') projectId: string,
+ @CurrentUserId() userId: string,
+ ): Promise<void> {
+ this.logger.log({ projectId, userId }, 'DELETE /project/:id/pin')
+
+ if (!isValidPID(projectId)) {
+ throw new BadRequestException('The provided project ID is incorrect')
+ }
+
+ await unpinProjectClickhouse(userId, projectId)
+ }
+
@Post('transfer')
@Auth()
async transferProject(
diff --git a/backend/migrations/clickhouse/selfhosted_2025_12_14_pinned_projects.js b/backend/migrations/clickhouse/selfhosted_2025_12_14_pinned_projects.js
new file mode 100644
index 000000000..b7e864628
--- /dev/null
+++ b/backend/migrations/clickhouse/selfhosted_2025_12_14_pinned_projects.js
@@ -0,0 +1,18 @@
+// This migration adds pinned projects support for self-hosted instances
+const { queriesRunner, dbName } = require('./setup')
+
+const queries = [
+ // Create pinned_project table for storing user's pinned/favorited projects
+ `CREATE TABLE IF NOT EXISTS ${dbName}.pinned_project
+ (
+ id String,
+ visitorId String,
+ projectId FixedString(12),
+ created DateTime('UTC')
+ )
+ ENGINE = ReplacingMergeTree(created)
+ ORDER BY (visitorId, projectId)
+ PARTITION BY toYYYYMM(created);`,
+]
+
+queriesRunner(queries)
diff --git a/backend/migrations/mysql/2025_12_14_pinned_projects.sql b/backend/migrations/mysql/2025_12_14_pinned_projects.sql
new file mode 100644
index 000000000..c94dbb470
--- /dev/null
+++ b/backend/migrations/mysql/2025_12_14_pinned_projects.sql
@@ -0,0 +1,14 @@
+-- Pinned projects table migration
+-- Allows users to pin/favorite projects for quick access
+CREATE TABLE IF NOT EXISTS `pinned_project` (
+ `id` varchar(36) NOT NULL,
+ `userId` varchar(36) NOT NULL,
+ `projectId` varchar(12) NOT NULL,
+ `created` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `UQ_pinned_project_user_project` (`userId`, `projectId`),
+ KEY `FK_pinned_project_user` (`userId`),
+ KEY `FK_pinned_project_project` (`projectId`),
+ FOREIGN KEY (`userId`) REFERENCES `user` (`id`) ON DELETE CASCADE,
+ FOREIGN KEY (`projectId`) REFERENCES `project` (`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
diff --git a/web/app/api/index.ts b/web/app/api/index.ts
index 63e89c5ba..b54c4b981 100644
--- a/web/app/api/index.ts
+++ b/web/app/api/index.ts
@@ -431,6 +431,22 @@ export const deleteProject = (id: string) =>
throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
+export const pinProject = (id: string) =>
+ api
+ .post(`/project/${id}/pin`)
+ .then((response) => response.data)
+ .catch((error) => {
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
+ })
+
+export const unpinProject = (id: string) =>
+ api
+ .delete(`/project/${id}/pin`)
+ .then((response) => response.data)
+ .catch((error) => {
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
+ })
+
export const resetProject = (id: string) =>
api
.delete(`/project/reset/${id}`)
diff --git a/web/app/lib/models/Project.ts b/web/app/lib/models/Project.ts
index 131cba91e..4d536aab0 100644
--- a/web/app/lib/models/Project.ts
+++ b/web/app/lib/models/Project.ts
@@ -205,6 +205,7 @@ export interface Project {
botsProtectionLevel: 'off' | 'basic'
role?: Role
gscPropertyUri?: string | null
+ isPinned?: boolean
}
export interface Extension {
diff --git a/web/app/pages/Dashboard/ProjectCard.tsx b/web/app/pages/Dashboard/ProjectCard.tsx
index dc265d8f4..c9d7f246d 100644
--- a/web/app/pages/Dashboard/ProjectCard.tsx
+++ b/web/app/pages/Dashboard/ProjectCard.tsx
@@ -6,13 +6,30 @@ import _map from 'lodash/map'
import _replace from 'lodash/replace'
import _round from 'lodash/round'
import _size from 'lodash/size'
-import { Settings2Icon } from 'lucide-react'
-import React, { useState, useMemo } from 'react'
+import { Settings2Icon, PinIcon } from 'lucide-react'
+import React, { useState, useMemo, useCallback, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router'
import { toast } from 'sonner'
-import { acceptProjectShare } from '~/api'
+import { acceptProjectShare, pinProject, unpinProject } from '~/api'
+
+// Detect if device supports hover (i.e., not a touch-only device)
+const useIsTouchDevice = () => {
+ const [isTouchDevice, setIsTouchDevice] = useState(false)
+
+ useEffect(() => {
+ // Check if device is touch-only (no hover support)
+ const mediaQuery = window.matchMedia('(hover: none)')
+ setIsTouchDevice(mediaQuery.matches)
+
+ const handler = (e: MediaQueryListEvent) => setIsTouchDevice(e.matches)
+ mediaQuery.addEventListener('change', handler)
+ return () => mediaQuery.removeEventListener('change', handler)
+ }, [])
+
+ return isTouchDevice
+}
import useFeatureFlag from '~/hooks/useFeatureFlag'
import { OverallObject, Project } from '~/lib/models/Project'
import { FeatureFlag } from '~/lib/models/User'
@@ -46,6 +63,8 @@ interface MiniCardProps {
const MiniCard = ({ labelTKey, total, percChange }: MiniCardProps) => {
const { t } = useTranslation('common')
const statsDidGrowUp = percChange ? percChange >= 0 : false
+ const hasNoData = total === 0 || total === 'N/A'
+ const isLoading = total === null
return (
<div>
@@ -54,14 +73,23 @@ const MiniCard = ({ labelTKey, total, percChange }: MiniCardProps) => {
</Text>
<div className='flex font-bold'>
- {total === null ? (
- <Spin className='mt-2 !ml-0' />
+ {isLoading ? (
+ <Spin className='mt-2 ml-0!' />
+ ) : hasNoData ? (
+ <div className='flex items-baseline gap-1'>
+ <Text as='p' weight='bold' size='xl' colour='muted'>
+ —
+ </Text>
+ <Text as='span' size='xs' colour='muted' className='font-normal'>
+ {t('dashboard.noData')}
+ </Text>
+ </div>
) : (
<>
<Text as='p' weight='bold' size='xl' colour='secondary'>
{_isNumber(total) ? nFormatter(total) : total}
</Text>
- {_isNumber(percChange) ? (
+ {_isNumber(percChange) && percChange !== 0 ? (
<p
className={cx('flex items-start text-xs', {
'text-green-600': statsDidGrowUp,
@@ -104,13 +132,55 @@ export const ProjectCard = ({
const showPeriodSelector = useFeatureFlag(FeatureFlag['dashboard-period-selector'])
const { user, mergeUser } = useAuth()
+ const isTouchDevice = useIsTouchDevice()
const shareId = useMemo(
() => _find(project.share, (item) => item.user?.id === user?.id)?.id,
[project.share, user?.id],
)
- const { id, name, public: isPublic, active, isTransferring, share, organisation, role } = project
+ const { id, name, public: isPublic, active, isTransferring, share, organisation, role, isPinned } = project
+ const [isPinning, setIsPinning] = useState(false)
+ const [localIsPinned, setLocalIsPinned] = useState(isPinned)
+
+ // Sync local state with prop
+ useEffect(() => {
+ setLocalIsPinned(isPinned)
+ }, [isPinned])
+
+ const handlePinToggle = useCallback(
+ async (e: React.MouseEvent) => {
+ e.preventDefault()
+ e.stopPropagation()
+
+ if (isPinning) return
+
+ setIsPinning(true)
+ // Optimistically update local state
+ const newPinnedState = !localIsPinned
+ setLocalIsPinned(newPinnedState)
+
+ try {
+ if (!newPinnedState) {
+ await unpinProject(id)
+ toast.success(t('dashboard.unpinned'))
+ } else {
+ await pinProject(id)
+ toast.success(t('dashboard.pinned'))
+ }
+ // Silently refetch projects in background - don't await
+ refetchProjects()
+ } catch (reason: any) {
+ // Revert on error
+ setLocalIsPinned(!newPinnedState)
+ console.error('[ERROR] Error while toggling pin:', reason)
+ toast.error(t('apiNotifications.somethingWentWrong'))
+ } finally {
+ setIsPinning(false)
+ }
+ },
+ [id, localIsPinned, isPinning, refetchProjects, t],
+ )
const badges = useMemo(() => {
const list: BadgeProps[] = []
@@ -198,6 +268,10 @@ export const ProjectCard = ({
return params.toString()
}, [showPeriodSelector, activePeriod, isHostnameNavigationEnabled, project.name])
+ // Determine if action buttons should always be visible
+ // Show on touch devices, or when project is pinned
+ const alwaysShowActions = isTouchDevice || localIsPinned
+
return (
<Link
to={{
@@ -206,7 +280,7 @@ export const ProjectCard = ({
}}
onClick={onElementClick}
className={cx(
- 'relative cursor-pointer overflow-hidden rounded-xl border border-gray-200 bg-gray-50 transition-colors hover:bg-gray-200/70 dark:border-slate-800/25 dark:bg-slate-800/70 dark:hover:bg-slate-700/60',
+ 'group relative cursor-pointer overflow-hidden rounded-xl border border-gray-200 bg-gray-50 transition-colors hover:bg-gray-200/70 dark:border-slate-800/25 dark:bg-slate-800/70 dark:hover:bg-slate-700/60',
viewMode === 'list' ? 'flex items-center justify-between px-6 py-4' : 'min-h-[153.1px]',
)}
>
@@ -222,16 +296,35 @@ export const ProjectCard = ({
{name}
</Text>
- {project.isAccessConfirmed && role !== 'viewer' ? (
- <Link
- className='rounded-md border border-transparent p-1.5 text-gray-800 transition-colors hover:border-gray-300 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 hover:dark:border-slate-700/80 dark:hover:bg-slate-800 dark:hover:text-slate-300'
- onClick={(e) => e.stopPropagation()}
- to={_replace(routes.project_settings, ':id', id)}
- aria-label={`${t('project.settings.settings')} ${name}`}
+ <div
+ className={cx(
+ 'flex shrink-0 items-center transition-opacity',
+ alwaysShowActions ? 'opacity-100' : 'opacity-0 group-hover:opacity-100',
+ )}
+ >
+ <button
+ type='button'
+ className='rounded-md border border-transparent p-1.5 text-gray-800 transition-colors hover:border-gray-300 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:border-slate-700/80 dark:hover:bg-slate-800 dark:hover:text-slate-300'
+ onClick={handlePinToggle}
+ disabled={isPinning}
+ aria-label={localIsPinned ? t('dashboard.unpin') : t('dashboard.pin')}
>
- <Settings2Icon className='size-5' strokeWidth={1.5} />
- </Link>
- ) : null}
+ <PinIcon
+ className={cx('size-5 transition-transform', localIsPinned && 'rotate-[30deg]')}
+ strokeWidth={1.5}
+ />
+ </button>
+ {project.isAccessConfirmed && role !== 'viewer' ? (
+ <Link
+ className='rounded-md border border-transparent p-1.5 text-gray-800 transition-colors hover:border-gray-300 hover:bg-gray-50 hover:text-gray-900 dark:text-slate-400 dark:hover:border-slate-700/80 dark:hover:bg-slate-800 dark:hover:text-slate-300'
+ onClick={(e) => e.stopPropagation()}
+ to={_replace(routes.project_settings, ':id', id)}
+ aria-label={`${t('project.settings.settings')} ${name}`}
+ >
+ <Settings2Icon className='size-5' strokeWidth={1.5} />
+ </Link>
+ ) : null}
+ </div>
</div>
<div className='mt-1 flex shrink-0 flex-wrap gap-2'>
{badges.length > 0 ? (
diff --git a/web/app/routes/projects.$pid.password.tsx b/web/app/routes/projects.$pid.password.tsx
deleted file mode 100644
index 43b413e9d..000000000
--- a/web/app/routes/projects.$pid.password.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import ProjectProtectedPassword from '~/pages/Project/ProjectProtectedPassword'
-
-export default function ProjectProtectedPasswordRoute() {
- return <ProjectProtectedPassword />
-}
diff --git a/web/public/locales/en.json b/web/public/locales/en.json
index 432aafb26..caa29dbd7 100644
--- a/web/public/locales/en.json
+++ b/web/public/locales/en.json
@@ -139,6 +139,8 @@
"disable": "Disable",
"copied": "Copied",
"new": "New",
+ "all": "All",
+ "active": "Active",
"loading": "Loading..",
"edit": "Edit",
"account": "Account",
@@ -872,6 +874,11 @@
"public": "Public",
"shared": "Shared",
"disabled": "Disabled",
+ "pinned": "Pinned",
+ "unpinned": "Unpinned",
+ "pin": "Pin project",
+ "unpin": "Unpin project",
+ "noData": "no data",
"pageviews": "Pageviews",
"captchaEvents": "CAPTCHA events",
"firstSeen": "First seen",
@@ -1219,6 +1226,7 @@
"support": "Contact support"
},
"project": {
+ "passwordProtectedHint": "Please enter the password to view this dashboard.",
"captchaCompletions": "CAPTCHA completions",
"addAnnotation": "Add annotation",
"editAnnotation": "Edit annotation",