Improve ObjectEditor and PostmanTable UI/UX
- Enhanced JSON parsing with smart error handling for trailing commas - Fixed StructuredEditor array handling - array indices now non-editable - Improved PostmanTable styling: removed border radius, solid thead background - Enhanced icon spacing and alignment for better visual hierarchy - Added copy feedback system with green check icons (2500ms duration) - Restructured MindmapView node layout with dedicated action column - Added HTML rendering toggle for PostmanTable similar to MindmapView - Implemented consistent copy functionality across components - Removed debug console.log statements for cleaner codebase
This commit is contained in:
@@ -45,16 +45,14 @@ export const initConsentMode = () => {
|
||||
}
|
||||
|
||||
const isEEA = isEEAUser();
|
||||
const mode = process.env.NODE_ENV !== 'production' ? '[DEV]' : '[PROD]';
|
||||
|
||||
if (isEEA || process.env.NODE_ENV !== 'production') {
|
||||
// EEA users or development: Start with denied, wait for user consent
|
||||
if (isEEA) {
|
||||
// EEA users: Start with denied, wait for user consent
|
||||
window.gtag('consent', 'default', {
|
||||
...DEFAULT_CONSENT,
|
||||
region: isEEA ? ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'IS', 'LI', 'NO'] : ['US'],
|
||||
region: ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'IS', 'LI', 'NO'],
|
||||
wait_for_update: 500
|
||||
});
|
||||
console.log(`🍪 ${mode} Consent Mode v2 initialized - EEA user, consent required`);
|
||||
} else {
|
||||
// Non-EEA users: Automatically grant all consent
|
||||
window.gtag('consent', 'default', {
|
||||
@@ -62,7 +60,6 @@ export const initConsentMode = () => {
|
||||
region: ['US'],
|
||||
wait_for_update: 0 // No need to wait
|
||||
});
|
||||
console.log(`🍪 ${mode} Consent Mode v2 initialized - Non-EEA user, auto-granted all consent`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,11 +72,8 @@ export const updateConsent = (consentChoices) => {
|
||||
// Store consent in localStorage
|
||||
localStorage.setItem('consent_preferences', JSON.stringify({
|
||||
...consentChoices,
|
||||
timestamp: Date.now(),
|
||||
version: '2.0'
|
||||
timestamp: Date.now()
|
||||
}));
|
||||
|
||||
console.log('🍪 Consent updated:', consentChoices);
|
||||
};
|
||||
|
||||
// Get stored consent preferences
|
||||
@@ -101,20 +95,31 @@ export const getStoredConsent = () => {
|
||||
|
||||
// Check if consent banner should be shown
|
||||
export const shouldShowConsentBanner = () => {
|
||||
// In development, always show for testing
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
return !getStoredConsent();
|
||||
const isDev = process.env.NODE_ENV !== 'production';
|
||||
const isEEA = isEEAUser();
|
||||
const hasConsent = getStoredConsent();
|
||||
|
||||
// In development, only show for EEA users (for proper testing)
|
||||
if (isDev) {
|
||||
if (isEEA) {
|
||||
return !hasConsent;
|
||||
} else {
|
||||
// Auto-grant for non-EEA even in development
|
||||
if (!hasConsent) {
|
||||
updateConsent(CONSENT_CONFIGS.ACCEPT_ALL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// In production, only show for EEA users who haven't consented
|
||||
if (isEEAUser()) {
|
||||
return !getStoredConsent();
|
||||
if (isEEA) {
|
||||
return !hasConsent;
|
||||
}
|
||||
|
||||
// For non-EEA users, automatically grant all consent and never show banner
|
||||
if (!getStoredConsent()) {
|
||||
if (!hasConsent) {
|
||||
updateConsent(CONSENT_CONFIGS.ACCEPT_ALL);
|
||||
console.log('🍪 [AUTO] Non-EEA user - automatically granted all consent');
|
||||
}
|
||||
|
||||
return false; // Never show banner for non-EEA users
|
||||
|
||||
Reference in New Issue
Block a user