From 0e203e8c716ca1024542bf65b8f7b708653ced6b Mon Sep 17 00:00:00 2001 From: Alexandre Amoedo Amorim Date: Mon, 13 Jan 2025 09:40:42 -0300 Subject: [PATCH] Hide fields related to old templates from the UI (#2246) --- .../team/SmoochBot/SmoochBotSettings.js | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/app/components/team/SmoochBot/SmoochBotSettings.js b/src/app/components/team/SmoochBot/SmoochBotSettings.js index c11ee8c096..c990276dfc 100644 --- a/src/app/components/team/SmoochBot/SmoochBotSettings.js +++ b/src/app/components/team/SmoochBot/SmoochBotSettings.js @@ -9,6 +9,16 @@ import styles from '../Settings.module.css'; const SmoochBotSettings = (props) => { const fields = props.schema; + const fieldsNotInUse = [ + 'smooch_template_name_for_fact_check_report_image_only', + 'smooch_template_name_for_fact_check_report_text_only', + 'smooch_template_name_for_fact_check_report_updated_image_only', + 'smooch_template_name_for_fact_check_report_updated_text_only', + 'smooch_template_name_for_more_information_needed_text_only', + 'smooch_template_name_for_newsletter', + 'smooch_template_name_for_newsletter_with_button', + ]; + return (
@@ -88,15 +98,18 @@ const SmoochBotSettings = (props) => { ))}
- {Object.keys(fields).filter(f => /^smooch_template_name_for_/.test(f)).map(field => ( - - ))} + {Object.keys(fields) + .filter(f => /^smooch_template_name_for_/.test(f)) + .filter(f => !fieldsNotInUse.includes(f)) + .map(field => ( + + ))}