Skip to content

Commit 4d228be

Browse files
authored
Merge pull request #66 from varun-raj/feat-nov-release
Feat: Heatman and versioning fixes
2 parents 2085174 + 12df97b commit 4d228be

File tree

7 files changed

+29
-25
lines changed

7 files changed

+29
-25
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
password: ${{ secrets.GITHUB_TOKEN }}
4444
- name: Build and push Docker image
4545
run: |
46-
docker build --build-arg BUILD_VERSION=${{ needs.release.outputs.new-release-version }} VERSION=${{ needs.release.outputs.new-release-version }} \
47-
-t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
46+
echo VERSION=${{ needs.release.outputs.new-release-version }} >> .env
47+
docker build -t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
4848
-t ghcr.io/${{ github.repository }}:latest .
4949
docker push ghcr.io/${{ github.repository }}:latest
5050
docker push ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
# Install dependencies only when needed
44
FROM node:18-alpine AS deps
55
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
6+
67
RUN apk add --no-cache libc6-compat
78
WORKDIR /app
89
COPY package.json ./
910
RUN npm install --frozen-lockfile
1011

1112
# Rebuild the source code only when needed
1213
FROM node:18-alpine AS builder
14+
1315
WORKDIR /app
1416
COPY --from=deps /app/node_modules ./node_modules
1517
COPY . .

bun.lockb

4.05 KB
Binary file not shown.

docker-compose.build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ services:
1010
- "3000:3000"
1111
env_file:
1212
- .env
13-
environment:
14-
- BUILD_VERSION=${BUILD_VERSION}

next.config.mjs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
/** @type {import('next').NextConfig} */
22

3-
import { readFileSync } from 'fs';
4-
5-
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
6-
7-
console.log(`Version: ${version}`);
8-
93
const nextConfig = {
104
reactStrictMode: false,
115
output: 'standalone',
126
images: {
137
unoptimized: true,
148
},
159
env: {
16-
VERSION: process.env.BUILD_VERSION || version,
10+
VERSION: process.env.VERSION,
1711
},
1812
};
1913

src/components/analytics/exif/AssetHeatMap.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React, { useEffect, useState } from "react";
22
import { getHeatMapData } from "@/handlers/api/analytics.handler";
33
import { useConfig } from "@/contexts/ConfigContext";
4+
import { Tooltip } from "@/components/ui/tooltip";
45

56
type HeatMapEntry = {
67
date: string;
78
count: number;
89
};
910

1011
export default function AssetHeatMap() {
11-
const { exImmichUrl } = useConfig();
12+
const { exImmichUrl } = useConfig();
1213

1314
const [heatMapData, setHeatMapData] = useState<HeatMapEntry[][]>([]);
1415
const [loading, setLoading] = useState(false);
@@ -117,18 +118,19 @@ export default function AssetHeatMap() {
117118
>
118119
{
119120
column[rowIndex]?.date ? (
120-
<a
121-
href={`${exImmichUrl}/search?query=%7B%22takenAfter%22%3A%22${column[rowIndex]?.date ?? "N/A"}T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22${column[rowIndex]?.date ?? "N/A"}T23%3A59%3A59.999Z%22%7D`}
122-
className="block h-full w-full"
123-
target="_blank"
124-
>
125-
<div
126-
className="h-full w-full"
127-
title={`Date: ${column[rowIndex]?.date ?? "N/A"}, Count: ${column[rowIndex]?.count ?? 0}`}
128-
/>
129-
</a>) : <div
121+
<Tooltip delayDuration={0} content={`Date: ${column[rowIndex]?.date ?? "N/A"} - Count: ${column[rowIndex]?.count ?? 0}`}>
122+
<a
123+
href={`${exImmichUrl}/search?query=%7B%22takenAfter%22%3A%22${column[rowIndex]?.date ?? "N/A"}T00%3A00%3A00.000Z%22%2C%22takenBefore%22%3A%22${column[rowIndex]?.date ?? "N/A"}T23%3A59%3A59.999Z%22%7D`}
124+
className="block h-full w-full"
125+
target="_blank"
126+
>
127+
<div
128+
className="h-full w-full"
129+
/>
130+
</a></Tooltip>) : <div
130131
className="h-full w-full"
131132
/>
133+
132134
}
133135
</td>
134136
))}

src/components/ui/tooltip.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,22 @@ const TooltipContent = React.forwardRef<
2626
TooltipContent.displayName = TooltipPrimitive.Content.displayName
2727

2828

29-
const Tooltip: React.FC<React.ComponentProps<typeof TooltipRoot>> = ({
29+
export interface ITooltipProps extends React.ComponentProps<typeof TooltipRoot> {
30+
content: string
31+
}
32+
const Tooltip: React.FC<ITooltipProps> = ({
3033
children,
34+
content,
3135
...props
3236
}) => (
3337
<TooltipProvider>
3438
<TooltipRoot {...props}>
35-
{children}
36-
<TooltipContent />
39+
<TooltipTrigger asChild>
40+
{children}
41+
</TooltipTrigger>
42+
<TooltipContent>
43+
<p>{content}</p>
44+
</TooltipContent>
3745
</TooltipRoot>
3846
</TooltipProvider>
3947
)

0 commit comments

Comments
 (0)