Merge pull request 'fix/my-listings-buttons' (#19) from fix/my-listings-buttons into master
Some checks are pending
CI / checks (push) Waiting to run
Some checks are pending
CI / checks (push) Waiting to run
Reviewed-on: #19
This commit is contained in:
commit
7c48d0e086
5 changed files with 44 additions and 11 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue