feat(cms): "View site" link in admin header (MITHOME-97 follow-up)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
User request: there was no way to get from the Payload admin back to the public website — confirmed live (read_page on the admin nav showed only internal links: collections, globals, account, logout). Added a "🌐 Honlap megnyitása" link next to the QuickSearch box (src/components/admin/QuickSearch.tsx — same header slot, no new admin.components entry or importmap regen needed since the export name didn't change). Opens in a new tab, points at siteConfig.general.url (NEXT_PUBLIC_SITE_URL), so it resolves to the correct site per environment automatically — stage.mozdit.hu on staging, the production domain once that's live. Verified live in the browser: link renders next to the search box, resolves to the expected URL (find() confirmed the href), zero new console errors in a fresh tab. Gate: tsc, lint, unit tests (51 passed), production build all green. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
c07ec2298c
commit
314b129259
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import Link from 'next/link'
|
||||
import { siteConfig } from '@/config/site'
|
||||
|
||||
/**
|
||||
* MITHOME-120 — teljes szöveges gyorskeresés a Payload admin tetején.
|
||||
@@ -18,6 +19,12 @@ import Link from 'next/link'
|
||||
* Regisztrálva: payload.config.ts `admin.components.header` — minden admin
|
||||
* oldalon megjelenik. Az importMap.js-t a `payload generate:importmap`
|
||||
* generálja újra, ha ez a fájl elmozdul/átnevezik.
|
||||
*
|
||||
* A keresés mellett egy "Honlap megnyitása" link is itt kapott helyet
|
||||
* (felhasználói kérés) — korábban semmilyen link nem vezetett az admin
|
||||
* felületről a publikus oldalra. `siteConfig.general.url` a
|
||||
* NEXT_PUBLIC_SITE_URL-ből jön, tehát környezetenként (dev/staging/prod)
|
||||
* automatikusan a helyes címre mutat.
|
||||
*/
|
||||
|
||||
type Locale = 'hu' | 'en'
|
||||
@@ -199,12 +206,15 @@ export function QuickSearch() {
|
||||
<div
|
||||
ref={containerRef}
|
||||
style={{
|
||||
position: 'relative',
|
||||
maxWidth: 480,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 12,
|
||||
maxWidth: 620,
|
||||
margin: '0 auto',
|
||||
padding: '10px 16px',
|
||||
}}
|
||||
>
|
||||
<div style={{ position: 'relative', flex: 1 }}>
|
||||
<input
|
||||
type="search"
|
||||
value={query}
|
||||
@@ -234,8 +244,8 @@ export function QuickSearch() {
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: '100%',
|
||||
left: 16,
|
||||
right: 16,
|
||||
left: 0,
|
||||
right: 0,
|
||||
marginTop: 4,
|
||||
maxHeight: 420,
|
||||
overflowY: 'auto',
|
||||
@@ -274,6 +284,24 @@ export function QuickSearch() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<a
|
||||
href={siteConfig.general.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style={{
|
||||
flexShrink: 0,
|
||||
padding: '8px 12px',
|
||||
fontSize: 14,
|
||||
borderRadius: 4,
|
||||
border: '1px solid var(--theme-elevation-150, #ccc)',
|
||||
color: 'var(--theme-text, #000)',
|
||||
textDecoration: 'none',
|
||||
whiteSpace: 'nowrap',
|
||||
}}
|
||||
>
|
||||
🌐 Honlap megnyitása
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user