Merge pull request #66 from varun-raj/feat-nov-release

Feat: Heatman and versioning fixes
This commit is contained in:
Varun Raj Manoharan authored and GitHub committed 2024-11-23 13:14:54 +05:30
commit 4d228bebc0
7 files changed
+29 -25

No files matched your search

+2 -2
View File
@@ -43,8 +43,8 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build --build-arg BUILD_VERSION=${{ needs.release.outputs.new-release-version }} VERSION=${{ needs.release.outputs.new-release-version }} \
-t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
echo VERSION=${{ needs.release.outputs.new-release-version }} >> .env
docker build -t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
-t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }}
+2
View File
@@ -3,6 +3,7 @@
# Install dependencies only when needed
FROM node:18-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json ./
@@ -10,6 +11,7 @@ RUN npm install --frozen-lockfile
# Rebuild the source code only when needed
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
BIN
View File
Binary file not shown.
-2
View File
@@ -10,5 +10,3 @@ services:
- "3000:3000"
env_file:
- .env
environment:
- BUILD_VERSION=${BUILD_VERSION}
+1 -7
View File
@@ -1,11 +1,5 @@
/** @type {import('next').NextConfig} */
import { readFileSync } from 'fs';
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
console.log(`Version: ${version}`);
const nextConfig = {
reactStrictMode: false,
output: 'standalone',
@@ -13,7 +7,7 @@ const nextConfig = {
unoptimized: true,
},
env: {
VERSION: process.env.BUILD_VERSION || version,
VERSION: process.env.VERSION,
},
};
+13 -11
View File
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from "react";
import { getHeatMapData } from "@/handlers/api/analytics.handler";
import { useConfig } from "@/contexts/ConfigContext";
import { Tooltip } from "@/components/ui/tooltip";
type HeatMapEntry = {
date: string;
@@ -8,7 +9,7 @@ type HeatMapEntry = {
};
export default function AssetHeatMap() {
const { exImmichUrl } = useConfig();
const { exImmichUrl } = useConfig();
const [heatMapData, setHeatMapData] = useState<HeatMapEntry[][]>([]);
const [loading, setLoading] = useState(false);
@@ -117,18 +118,19 @@ export default function AssetHeatMap() {
>
{
column[rowIndex]?.date ? (
<a
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`}
className="block h-full w-full"
target="_blank"
>
<div
className="h-full w-full"
title={`Date: ${column[rowIndex]?.date ?? "N/A"}, Count: ${column[rowIndex]?.count ?? 0}`}
/>
</a>) : <div
<Tooltip delayDuration={0} content={`Date: ${column[rowIndex]?.date ?? "N/A"} - Count: ${column[rowIndex]?.count ?? 0}`}>
<a
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`}
className="block h-full w-full"
target="_blank"
>
<div
className="h-full w-full"
/>
</a></Tooltip>) : <div
className="h-full w-full"
/>
}
</td>
))}
+11 -3
View File
@@ -26,14 +26,22 @@ const TooltipContent = React.forwardRef<
TooltipContent.displayName = TooltipPrimitive.Content.displayName
const Tooltip: React.FC<React.ComponentProps<typeof TooltipRoot>> = ({
export interface ITooltipProps extends React.ComponentProps<typeof TooltipRoot> {
content: string
}
const Tooltip: React.FC<ITooltipProps> = ({
children,
content,
...props
}) => (
<TooltipProvider>
<TooltipRoot {...props}>
{children}
<TooltipContent />
<TooltipTrigger asChild>
{children}
</TooltipTrigger>
<TooltipContent>
<p>{content}</p>
</TooltipContent>
</TooltipRoot>
</TooltipProvider>
)