Compare commits

..

4 commits

Author SHA1 Message Date
Tero Halla-aho
0286c7f5be Fix duplicate AvailabilityCalendar import in listing page
Some checks failed
CI / checks (push) Has been cancelled
CI / checks (pull_request) Has been cancelled
2025-12-21 22:07:03 +02:00
Tero Halla-aho
beb60966d4 Make deploy build script container-engine aware 2025-12-21 22:04:56 +02:00
Tero Halla-aho
8c92385885 Fix My listings edit button label 2025-12-21 21:58:08 +02:00
Tero Halla-aho
9022c033f7 Document branch workflow expectation 2025-12-21 21:58:03 +02:00
5 changed files with 44 additions and 11 deletions

View file

@ -5,6 +5,7 @@
- When updating `PROGRESS.md`, add a date marker (e.g., `## YYYY-MM-DD — …`) and list changes under it until the date changes; keep earlier entries intact and sorted by date.
- After that, scan the repo structure (e.g., list key dirs/files) to regain context before continuing work.
- After finishing each new feature, create a git commit with a sensible message and update documentation to reflect the changes.
- Always assume work should continue on a feature or fix branch; if unsure whether to reuse a previous branch (which might already be pushed and deleted), ask before proceeding.
## Ongoing reminders
- If needed, render diagrams locally from `docs/plantuml` or `docs/drawio` for reference.

View file

@ -8,7 +8,6 @@ import { SAMPLE_LISTING_SLUGS } from '../../../lib/sampleListing';
import { resolveLocale, t as translate } from '../../../lib/i18n';
import AvailabilityCalendar from '../../components/AvailabilityCalendar';
import { verifyAccessToken } from '../../../lib/jwt';
import AvailabilityCalendar from '../../components/AvailabilityCalendar';
import { getSiteSettings } from '../../../lib/settings';
import type { UrlObject } from 'url';

View file

@ -104,7 +104,7 @@ export default function MyListingsPage() {
</div>
<div style={{ marginTop: 8, display: 'flex', gap: 8 }}>
<Link href={`/listings/edit/${l.id}`} className="button secondary">
{l.status === 'DRAFT' ? 'Edit' : t('view')}
{t('edit')}
</Link>
{l.status !== 'DRAFT' ? (
<Link href={`/listings/${l.translations[0]?.slug ?? ''}`} className="button secondary">

View file

@ -3,6 +3,7 @@ set -euo pipefail
cd "$(dirname "$0")/.."
source deploy/env.sh
CONTAINER_TOOL="${CONTAINER_TOOL:-}"
AGE_KEY_FILE_CANDIDATES=(
"${SOPS_AGE_KEY_FILE:-}"
@ -34,14 +35,34 @@ require_cmd() {
}
check_docker() {
if [[ -n "${SKIP_DOCKER_CHECK:-}" ]]; then
echo "Deprecated: check_docker is kept for compatibility. Use check_container_engine instead." >&2
check_container_engine
}
check_container_engine() {
if [[ -n "${SKIP_DOCKER_CHECK:-}" || -n "${SKIP_CONTAINER_BUILD:-}" ]]; then
return
fi
require_cmd docker
if ! docker info >/dev/null 2>&1; then
echo "Docker is installed but the daemon is not reachable. Start Docker Desktop/Engine and try again." >&2
if [[ -n "$CONTAINER_TOOL" ]]; then
require_cmd "$CONTAINER_TOOL"
if "$CONTAINER_TOOL" info >/dev/null 2>&1; then
return
fi
echo "$CONTAINER_TOOL is installed but the daemon/service is not reachable. Start it or choose another engine via CONTAINER_TOOL." >&2
exit 1
fi
for candidate in docker podman nerdctl; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" info >/dev/null 2>&1; then
CONTAINER_TOOL="$candidate"
export CONTAINER_TOOL
return
fi
done
echo "No working container engine found (checked docker, podman, nerdctl). Start one or set CONTAINER_TOOL to a reachable engine." >&2
exit 1
}
check_age_setup() {
@ -102,7 +123,7 @@ echo "Running pre-flight checks..."
for tool in git npm; do
require_cmd "$tool"
done
check_docker
check_container_engine
check_age_setup
if [[ -z "${SKIP_DB_MIGRATION_CHECK:-}" ]]; then
if command -v npx >/dev/null 2>&1; then
@ -132,12 +153,21 @@ echo "Building image:"
echo " $IMAGE"
echo " $IMAGE_LATEST"
# npm audit (high severity and above)
echo "Running npm audit (high)..."
npm audit --audit-level=high || echo "npm audit reported issues above."
if [[ -z "${SKIP_NPM_AUDIT:-}" ]]; then
# npm audit (high severity and above)
echo "Running npm audit (high)..."
npm audit --audit-level=high || echo "npm audit reported issues above."
else
echo "Skipping npm audit (SKIP_NPM_AUDIT set)."
fi
if [[ -n "${SKIP_CONTAINER_BUILD:-}" ]]; then
echo "Skipping container build (SKIP_CONTAINER_BUILD set)."
exit 0
fi
# Build
docker build --build-arg APP_VERSION="$GIT_SHA" -t "$IMAGE" -t "$IMAGE_LATEST" .
"${CONTAINER_TOOL:-docker}" build --build-arg APP_VERSION="$GIT_SHA" -t "$IMAGE" -t "$IMAGE_LATEST" .
echo "$IMAGE" > deploy/.last-image

View file

@ -131,6 +131,7 @@ const baseMessages = {
noListings: 'No listings yet.',
createOne: 'Create one',
loading: 'Loading…',
edit: 'Edit',
view: 'View',
removing: 'Removing…',
removed: 'Listing removed',
@ -513,6 +514,7 @@ const baseMessages = {
noListings: 'Ei kohteita vielä.',
createOne: 'Luo kohde',
loading: 'Ladataan…',
edit: 'Muokkaa',
view: 'Näytä',
removing: 'Poistetaan…',
removed: 'Kohde poistettu näkyvistä',
@ -754,6 +756,7 @@ const svMessages: Record<keyof typeof baseMessages.en, string> = {
heroBody: 'Upptäck stugor, lägenheter och villor direkt från ägarna. Annonser verifieras innan publicering och du kontaktar värdarna direkt — enkelt och transparent.',
ctaBrowse: 'Bläddra bland annonser',
createListingTitle: 'Skapa annons',
edit: 'Redigera',
languageTabsLabel: 'Annonsens språk',
languageTabsHint: 'Lägg till översättningar för varje språk',
localeSectionTitle: 'Annonsinnehåll',