diff --git a/airflow/www/static/js/grid/ToggleGroups.jsx b/airflow/www/static/js/grid/ToggleGroups.jsx index 52de1b9811a12..193c3b81f0a51 100644 --- a/airflow/www/static/js/grid/ToggleGroups.jsx +++ b/airflow/www/static/js/grid/ToggleGroups.jsx @@ -40,7 +40,7 @@ const getGroupIds = (groups) => { }; const ToggleGroups = ({ groups }) => { - const openGroupsKey = `${dagId}-open-groups`; + const openGroupsKey = `${dagId}/open-groups`; const allGroupIds = getGroupIds(groups.children); const storedGroups = JSON.parse(localStorage.getItem(openGroupsKey)) || []; const [openGroupIds, setOpenGroupIds] = useState(storedGroups); diff --git a/airflow/www/static/js/grid/renderTaskRows.jsx b/airflow/www/static/js/grid/renderTaskRows.jsx index dd70bc8163475..e16f05dd4a193 100644 --- a/airflow/www/static/js/grid/renderTaskRows.jsx +++ b/airflow/www/static/js/grid/renderTaskRows.jsx @@ -87,7 +87,7 @@ const TaskInstances = ({ ); -const storageKey = `${dagId}-open-groups`; +const openGroupsKey = `${dagId}/open-groups`; const Row = (props) => { const { @@ -103,7 +103,7 @@ const Row = (props) => { const isGroup = !!task.children; const isSelected = selected.taskId === task.id; - const openGroups = JSON.parse(localStorage.getItem(storageKey)) || []; + const openGroups = JSON.parse(localStorage.getItem(openGroupsKey)) || []; const defaultIsOpen = openGroups.some((g) => g === task.label); const { @@ -129,10 +129,10 @@ const Row = (props) => { () => { if (isGroup) { if (!isOpen) { - localStorage.setItem(storageKey, JSON.stringify([...openGroups, task.label])); + localStorage.setItem(openGroupsKey, JSON.stringify([...openGroups, task.label])); } else { localStorage.setItem( - storageKey, + openGroupsKey, JSON.stringify(openGroups.filter((g) => g !== task.label)), ); }