Skip to content

Commit 9b58b47

Browse files
committed
Centralize legal policy settings in Privacy
1 parent d6123bf commit 9b58b47

5 files changed

Lines changed: 128 additions & 196 deletions

File tree

LYNX/server/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ const validateConsentConfigDomain = (config, legalUrls = {}) => {
17841784
if (config.mode === 'hardcoded' && config.enabled) {
17851785
const { categories = {} } = config.hardcoded || {};
17861786
if (!legalUrls.privacyPolicyUrl && !legalUrls.cookiePolicyUrl) {
1787-
errors.push('At least one policy URL must be configured in Admin > Profile > Legal links when the native banner is enabled.');
1787+
errors.push('At least one policy URL must be configured in Admin > Privacy > Legal policies when the native banner is enabled.');
17881788
}
17891789
for (const [key, cat] of Object.entries(categories)) {
17901790
if (cat.enabled && !cat.description?.trim()) {

LYNX/src/components/AdminView.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ interface AdminViewProps {
6565
profile: ProfileData;
6666
links: LinkData[];
6767
theme: ThemeConfig;
68-
onProfileUpdate: (profile: ProfileData) => void;
68+
onProfileUpdate: (profile: ProfileData) => void | Promise<void>;
6969
onLinksUpdate: (links: LinkData[]) => void;
7070
onThemeChange: (theme: ThemeConfig) => void;
7171
onLogout: () => void;
@@ -136,7 +136,7 @@ export const AdminView = ({
136136
};
137137

138138
const handleSaveIntegrations = () => {
139-
onProfileUpdate({ ...profile, googleAnalyticsId: gaId.trim() || undefined });
139+
void onProfileUpdate({ ...profile, googleAnalyticsId: gaId.trim() || undefined });
140140
setGaSaved(true);
141141
setTimeout(() => setGaSaved(false), 2500);
142142
};
@@ -215,7 +215,7 @@ export const AdminView = ({
215215
<div className="admin-main-column">
216216
<ProfileSection
217217
profile={profile}
218-
onProfileUpdate={onProfileUpdate}
218+
onProfileUpdate={(nextProfile) => { void onProfileUpdate(nextProfile); }}
219219
/>
220220
</div>
221221
<aside className="admin-side-panel admin-checklist-panel">
@@ -342,7 +342,9 @@ export const AdminView = ({
342342
<PrivacySettings
343343
privacyPolicyUrl={profile.privacyPolicyUrl}
344344
cookiePolicyUrl={profile.cookiePolicyUrl}
345-
onEditLegalLinks={() => setActiveTab("profile")}
345+
onLegalPolicyUpdate={({ privacyPolicyUrl, cookiePolicyUrl }) =>
346+
onProfileUpdate({ ...profile, privacyPolicyUrl, cookiePolicyUrl })
347+
}
346348
/>
347349
</TabsContent>
348350
</Tabs>

0 commit comments

Comments
 (0)