@prenta/admin 2.14.5 → 2.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/__tests__/views/form-entries.render.test.js +13 -0
- package/dist/__tests__/views/form-entries.render.test.js.map +1 -1
- package/dist/prenta-admin.css +1 -1
- package/dist/views/entries/EntriesInbox.js +16 -16
- package/dist/views/entries/EntriesInbox.js.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/views/form-entries.render.test.tsx +15 -0
- package/src/views/entries/EntriesInbox.tsx +133 -130
|
@@ -2789,154 +2789,157 @@ function EntryDetail({
|
|
|
2789
2789
|
</div>
|
|
2790
2790
|
</div>
|
|
2791
2791
|
|
|
2792
|
-
{/* Grey body area: cards
|
|
2792
|
+
{/* Grey body area: cards. The left stack is one grid cell so a short
|
|
2793
|
+
Message card does not inherit the height of the attribution column. */}
|
|
2793
2794
|
<div className="mx-auto max-w-[860px] px-8 pt-[22px] pb-12 max-[900px]:px-4 max-[900px]:pt-4 max-[900px]:pb-10 @[1240px]:grid @[1240px]:max-w-[1180px] @[1240px]:grid-cols-[minmax(0,1fr)_400px] @[1240px]:items-start @[1240px]:gap-x-5">
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
<h3
|
|
2800
|
-
id="d-msg-l"
|
|
2801
|
-
className="border-bdr text-txt m-0 flex items-center gap-2 border-b px-5 py-3 text-[13px] font-semibold"
|
|
2795
|
+
<div className="min-w-0 @[1240px]:col-start-1 @[1240px]:row-start-1">
|
|
2796
|
+
{msgEntry ? (
|
|
2797
|
+
<article
|
|
2798
|
+
className="group border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border"
|
|
2799
|
+
aria-labelledby="d-msg-l"
|
|
2802
2800
|
>
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
title={`Copy ${messageTitle}`}
|
|
2807
|
-
aria-label={`Copy ${messageTitle}`}
|
|
2808
|
-
onClick={() => copyValue(msgText)}
|
|
2809
|
-
className="text-faint hover:bg-acc-l hover:text-acc ml-auto inline-flex size-6 items-center justify-center rounded-[6px] opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100"
|
|
2801
|
+
<h3
|
|
2802
|
+
id="d-msg-l"
|
|
2803
|
+
className="border-bdr text-txt m-0 flex items-center gap-2 border-b px-5 py-3 text-[13px] font-semibold"
|
|
2810
2804
|
>
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
{formatFieldDisplay(msgEntry.key, msgText, fieldMap.get(msgEntry.key))}
|
|
2819
|
-
</div>
|
|
2820
|
-
</article>
|
|
2821
|
-
) : null}
|
|
2822
|
-
{/* Submission card */}
|
|
2823
|
-
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border @[1240px]:col-start-1">
|
|
2824
|
-
<h3 className="border-bdr text-faint m-0 flex items-center gap-2 border-b px-5 py-3 text-[11px] font-bold tracking-[0.6px] uppercase">
|
|
2825
|
-
Submission
|
|
2826
|
-
<span className="ml-auto text-[11.5px] font-semibold tracking-normal normal-case">
|
|
2827
|
-
{answeredCount} of {present.length} answered
|
|
2828
|
-
</span>
|
|
2829
|
-
</h3>
|
|
2830
|
-
<dl className="divide-bdr m-0 divide-y">
|
|
2831
|
-
{visibleRows.map(({ key, label }) => {
|
|
2832
|
-
const raw = displayValue(entry.data[key])
|
|
2833
|
-
const formatted = formatFieldDisplay(key, raw, fieldMap.get(key))
|
|
2834
|
-
return (
|
|
2835
|
-
<DetailRow
|
|
2836
|
-
key={key}
|
|
2837
|
-
label={label}
|
|
2838
|
-
copyText={formatted || undefined}
|
|
2839
|
-
onCopy={copyValue}
|
|
2805
|
+
{messageTitle}
|
|
2806
|
+
<button
|
|
2807
|
+
type="button"
|
|
2808
|
+
title={`Copy ${messageTitle}`}
|
|
2809
|
+
aria-label={`Copy ${messageTitle}`}
|
|
2810
|
+
onClick={() => copyValue(msgText)}
|
|
2811
|
+
className="text-faint hover:bg-acc-l hover:text-acc ml-auto inline-flex size-6 items-center justify-center rounded-[6px] opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100"
|
|
2840
2812
|
>
|
|
2841
|
-
|
|
2842
|
-
</
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
className="border-bdr text-acc hover:bg-acc-l block w-full cursor-pointer border-0 border-t bg-transparent px-5 py-2.5 text-left text-[12.5px] font-medium"
|
|
2852
|
-
>
|
|
2853
|
-
{showAllFields ? 'Show fewer fields' : `Show all fields (${hiddenFieldSummary})`}
|
|
2854
|
-
</button>
|
|
2813
|
+
<Copy size={13} aria-hidden />
|
|
2814
|
+
</button>
|
|
2815
|
+
</h3>
|
|
2816
|
+
<div
|
|
2817
|
+
dir="auto"
|
|
2818
|
+
className="text-txt px-5 pt-4 pb-5 text-[15px] leading-[1.7] [text-wrap:pretty] break-words whitespace-pre-wrap"
|
|
2819
|
+
>
|
|
2820
|
+
{formatFieldDisplay(msgEntry.key, msgText, fieldMap.get(msgEntry.key))}
|
|
2821
|
+
</div>
|
|
2822
|
+
</article>
|
|
2855
2823
|
) : null}
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
{/* Team notes card */}
|
|
2859
|
-
{entry.spamStatus !== 'spam' && !entry.partial ? (
|
|
2860
|
-
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border @[1240px]:col-start-1">
|
|
2824
|
+
{/* Submission card */}
|
|
2825
|
+
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border">
|
|
2861
2826
|
<h3 className="border-bdr text-faint m-0 flex items-center gap-2 border-b px-5 py-3 text-[11px] font-bold tracking-[0.6px] uppercase">
|
|
2862
|
-
|
|
2827
|
+
Submission
|
|
2863
2828
|
<span className="ml-auto text-[11.5px] font-semibold tracking-normal normal-case">
|
|
2864
|
-
{
|
|
2829
|
+
{answeredCount} of {present.length} answered
|
|
2865
2830
|
</span>
|
|
2866
2831
|
</h3>
|
|
2867
|
-
<
|
|
2868
|
-
{
|
|
2869
|
-
const
|
|
2870
|
-
|
|
2871
|
-
n.authorName ||
|
|
2872
|
-
n.authorId ||
|
|
2873
|
-
'Team'
|
|
2832
|
+
<dl className="divide-bdr m-0 divide-y">
|
|
2833
|
+
{visibleRows.map(({ key, label }) => {
|
|
2834
|
+
const raw = displayValue(entry.data[key])
|
|
2835
|
+
const formatted = formatFieldDisplay(key, raw, fieldMap.get(key))
|
|
2874
2836
|
return (
|
|
2875
|
-
<
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
</span>
|
|
2882
|
-
|
|
2883
|
-
<div className="flex items-baseline gap-2 text-[12.5px]">
|
|
2884
|
-
<b className="text-txt font-semibold">{author}</b>
|
|
2885
|
-
<span className="text-faint text-[11.5px]">{fullEntryTime(n.at)}</span>
|
|
2886
|
-
</div>
|
|
2887
|
-
<div className="text-txt mt-0.5 text-[13px] leading-[1.5] whitespace-pre-wrap">
|
|
2888
|
-
{n.text}
|
|
2889
|
-
</div>
|
|
2890
|
-
</div>
|
|
2891
|
-
</div>
|
|
2837
|
+
<DetailRow
|
|
2838
|
+
key={key}
|
|
2839
|
+
label={label}
|
|
2840
|
+
copyText={formatted || undefined}
|
|
2841
|
+
onCopy={copyValue}
|
|
2842
|
+
>
|
|
2843
|
+
{formatted || <span className="text-faint">Not answered</span>}
|
|
2844
|
+
</DetailRow>
|
|
2892
2845
|
)
|
|
2893
2846
|
})}
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2847
|
+
</dl>
|
|
2848
|
+
{hiddenFieldSummary ? (
|
|
2849
|
+
<button
|
|
2850
|
+
type="button"
|
|
2851
|
+
aria-expanded={showAllFields}
|
|
2852
|
+
onClick={() => setShowAllFields((v) => !v)}
|
|
2853
|
+
className="border-bdr text-acc hover:bg-acc-l block w-full cursor-pointer border-0 border-t bg-transparent px-5 py-2.5 text-left text-[12.5px] font-medium"
|
|
2854
|
+
>
|
|
2855
|
+
{showAllFields ? 'Show fewer fields' : `Show all fields (${hiddenFieldSummary})`}
|
|
2856
|
+
</button>
|
|
2857
|
+
) : null}
|
|
2858
|
+
</article>
|
|
2859
|
+
|
|
2860
|
+
{/* Team notes card */}
|
|
2861
|
+
{entry.spamStatus !== 'spam' && !entry.partial ? (
|
|
2862
|
+
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border">
|
|
2863
|
+
<h3 className="border-bdr text-faint m-0 flex items-center gap-2 border-b px-5 py-3 text-[11px] font-bold tracking-[0.6px] uppercase">
|
|
2864
|
+
Team notes
|
|
2865
|
+
<span className="ml-auto text-[11.5px] font-semibold tracking-normal normal-case">
|
|
2866
|
+
{notes.length} {notes.length === 1 ? 'note' : 'notes'}
|
|
2905
2867
|
</span>
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2868
|
+
</h3>
|
|
2869
|
+
<div className="flex flex-col gap-3.5 px-5 pt-3.5 pb-4">
|
|
2870
|
+
{notes.map((n, idx) => {
|
|
2871
|
+
const author =
|
|
2872
|
+
team.find((t) => t.id === n.authorId)?.name ||
|
|
2873
|
+
n.authorName ||
|
|
2874
|
+
n.authorId ||
|
|
2875
|
+
'Team'
|
|
2876
|
+
return (
|
|
2877
|
+
<div key={idx} className="flex gap-2.5">
|
|
2878
|
+
<span
|
|
2879
|
+
className="flex size-[26px] shrink-0 items-center justify-center rounded-full text-[11px] font-bold"
|
|
2880
|
+
style={{ background: avatarColor(author), color: 'var(--on-avatar)' }}
|
|
2881
|
+
>
|
|
2882
|
+
{initials(author)}
|
|
2883
|
+
</span>
|
|
2884
|
+
<div className="min-w-0 flex-1">
|
|
2885
|
+
<div className="flex items-baseline gap-2 text-[12.5px]">
|
|
2886
|
+
<b className="text-txt font-semibold">{author}</b>
|
|
2887
|
+
<span className="text-faint text-[11.5px]">{fullEntryTime(n.at)}</span>
|
|
2888
|
+
</div>
|
|
2889
|
+
<div className="text-txt mt-0.5 text-[13px] leading-[1.5] whitespace-pre-wrap">
|
|
2890
|
+
{n.text}
|
|
2891
|
+
</div>
|
|
2892
|
+
</div>
|
|
2893
|
+
</div>
|
|
2894
|
+
)
|
|
2895
|
+
})}
|
|
2896
|
+
{notes.length === 0 ? (
|
|
2897
|
+
<div className="text-faint text-[12.5px]">
|
|
2898
|
+
No notes yet. Notes are only visible to your team.
|
|
2899
|
+
</div>
|
|
2900
|
+
) : null}
|
|
2901
|
+
<div className="border-bdr flex gap-2.5 border-t pt-3">
|
|
2902
|
+
<span
|
|
2903
|
+
className="flex size-[26px] shrink-0 items-center justify-center rounded-full text-[11px] font-bold"
|
|
2904
|
+
style={{ background: avatarColor(currentUserName), color: 'var(--on-avatar)' }}
|
|
2905
|
+
>
|
|
2906
|
+
{initials(currentUserName)}
|
|
2907
|
+
</span>
|
|
2908
|
+
<div className="min-w-0 flex-1">
|
|
2909
|
+
<textarea
|
|
2910
|
+
rows={2}
|
|
2911
|
+
value={noteText}
|
|
2912
|
+
placeholder="Add a note for your team…"
|
|
2913
|
+
aria-label="Add a note"
|
|
2914
|
+
onChange={(e) => setNoteText(e.target.value)}
|
|
2915
|
+
onKeyDown={(e) => {
|
|
2916
|
+
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey) && noteText.trim()) {
|
|
2917
|
+
e.preventDefault()
|
|
2918
|
+
addNote()
|
|
2919
|
+
}
|
|
2920
|
+
}}
|
|
2921
|
+
className="border-bdr bg-card text-txt focus-visible:outline-acc min-h-[58px] w-full resize-y rounded-[9px] border px-2.5 py-2 text-[13px] leading-[1.45] focus-visible:outline focus-visible:outline-offset-2"
|
|
2922
|
+
/>
|
|
2923
|
+
<div className="text-faint mt-1.5 flex items-center gap-2.5 text-[11.5px]">
|
|
2924
|
+
<span className="flex-1">⌘ Enter to save · only visible to your team</span>
|
|
2925
|
+
<button
|
|
2926
|
+
type="button"
|
|
2927
|
+
disabled={!noteText.trim()}
|
|
2928
|
+
onClick={addNote}
|
|
2929
|
+
className="bg-acc inline-flex items-center gap-1.5 rounded-[8px] px-[15px] py-2 text-[13px] font-medium text-[var(--on-acc)] disabled:cursor-not-allowed disabled:opacity-45"
|
|
2930
|
+
>
|
|
2931
|
+
Add note
|
|
2932
|
+
</button>
|
|
2933
|
+
</div>
|
|
2931
2934
|
</div>
|
|
2932
2935
|
</div>
|
|
2933
2936
|
</div>
|
|
2934
|
-
</
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
+
</article>
|
|
2938
|
+
) : null}
|
|
2939
|
+
</div>
|
|
2937
2940
|
|
|
2938
2941
|
{/* Attribution & technical card */}
|
|
2939
|
-
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border @[1240px]:sticky @[1240px]:top-[68px] @[1240px]:col-start-2 @[1240px]:row-
|
|
2942
|
+
<article className="border-bdr bg-card shadow-shd mb-3.5 overflow-hidden rounded-[10px] border @[1240px]:sticky @[1240px]:top-[68px] @[1240px]:col-start-2 @[1240px]:row-start-1">
|
|
2940
2943
|
<h3 className="m-0">
|
|
2941
2944
|
<button
|
|
2942
2945
|
type="button"
|