Skip to content

Commit

Permalink
Merge pull request #66 from varun-raj/feat-nov-release
Browse files Browse the repository at this point in the history
Feat: Heatman and versioning fixes
  • Loading branch information
varun-raj authored Nov 23, 2024
2 parents 2085174 + 12df97b commit 4d228be
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
# 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 ./
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 . .
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 0 additions & 2 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ services:
- "3000:3000"
env_file:
- .env
environment:
- BUILD_VERSION=${BUILD_VERSION}
8 changes: 1 addition & 7 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
/** @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',
images: {
unoptimized: true,
},
env: {
VERSION: process.env.BUILD_VERSION || version,
VERSION: process.env.VERSION,
},
};

Expand Down
24 changes: 13 additions & 11 deletions src/components/analytics/exif/AssetHeatMap.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
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;
count: number;
};

export default function AssetHeatMap() {
const { exImmichUrl } = useConfig();
const { exImmichUrl } = useConfig();

const [heatMapData, setHeatMapData] = useState<HeatMapEntry[][]>([]);
const [loading, setLoading] = useState(false);
Expand Down Expand Up @@ -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>
))}
Expand Down
14 changes: 11 additions & 3 deletions src/components/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
Expand Down

0 comments on commit 4d228be

Please sign in to comment.