From 59de222bb26ac9e55e1dcafbffa5cee739c4ae66 Mon Sep 17 00:00:00 2001 From: okorie2 Date: Mon, 30 Oct 2023 11:04:33 +0100 Subject: [PATCH] fix: rename subheader title variable --- src/app/modules/common/subheader-toolbar/SubheaderToolbar.tsx | 2 +- src/app/modules/common/subheader-toolbar/data.ts | 2 +- .../report-module/sub-module/components/headerBlock/index.tsx | 4 ++-- .../report-module/sub-module/rowStructure/rowFrame.tsx | 2 -- src/app/modules/report-module/views/create/data.ts | 2 +- src/app/modules/report-module/views/create/index.tsx | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/modules/common/subheader-toolbar/SubheaderToolbar.tsx b/src/app/modules/common/subheader-toolbar/SubheaderToolbar.tsx index a567acbdd..e63b73316 100644 --- a/src/app/modules/common/subheader-toolbar/SubheaderToolbar.tsx +++ b/src/app/modules/common/subheader-toolbar/SubheaderToolbar.tsx @@ -434,7 +434,7 @@ export function SubheaderToolbar(props: SubheaderToolbarProps) { placeholder="Title" css={styles.nameInput} onChange={onNameChange} - onFocus={() => props.setHasReportNameFocused?.(true)} + onFocus={() => props.setHasSubHeaderTitleFocused?.(true)} onClick={(e) => { if (props.name === "Untitled report") { e.currentTarget.value = ""; diff --git a/src/app/modules/common/subheader-toolbar/data.ts b/src/app/modules/common/subheader-toolbar/data.ts index a16631c51..bd668b470 100644 --- a/src/app/modules/common/subheader-toolbar/data.ts +++ b/src/app/modules/common/subheader-toolbar/data.ts @@ -10,7 +10,7 @@ export interface SubheaderToolbarProps { forceEnablePreviewSave?: boolean; rawViz?: any; reportName: string; - setHasReportNameFocused?: (value: boolean) => void; + setHasSubHeaderTitleFocused?: (value: boolean) => void; headerDetails: IHeaderDetails; appliedHeaderDetails: IHeaderDetails; framesArray: IFramesArray[]; diff --git a/src/app/modules/report-module/sub-module/components/headerBlock/index.tsx b/src/app/modules/report-module/sub-module/components/headerBlock/index.tsx index 73a2288e2..36496d2c8 100644 --- a/src/app/modules/report-module/sub-module/components/headerBlock/index.tsx +++ b/src/app/modules/report-module/sub-module/components/headerBlock/index.tsx @@ -18,7 +18,7 @@ import useDebounce from "react-use/lib/useDebounce"; interface Props { previewMode: boolean; - hasReportNameFocused?: boolean; + hasSubHeaderTitleFocused?: boolean; setReportName?: React.Dispatch>; reportName?: string; headerDetails: { @@ -73,7 +73,7 @@ export default function HeaderBlock(props: Props) { () => { // checks when headerDetails.title is empty and report title has not been focused - if (!props.hasReportNameFocused && isReportTitleModified) { + if (!props.hasSubHeaderTitleFocused && isReportTitleModified) { props.setReportName?.(props.headerDetails.title); } }, diff --git a/src/app/modules/report-module/sub-module/rowStructure/rowFrame.tsx b/src/app/modules/report-module/sub-module/rowStructure/rowFrame.tsx index 2b9e37996..33a2b6500 100644 --- a/src/app/modules/report-module/sub-module/rowStructure/rowFrame.tsx +++ b/src/app/modules/report-module/sub-module/rowStructure/rowFrame.tsx @@ -312,8 +312,6 @@ export default function RowFrame(props: RowFrameProps) { }); }; - console.log(props.framesArray, "framesarray"); - React.useEffect(() => { setSelectedType(selectedTypeHistory[selectedTypeHistory.length - 1]); }, [selectedTypeHistory]); diff --git a/src/app/modules/report-module/views/create/data.ts b/src/app/modules/report-module/views/create/data.ts index f16a3e949..af70321b6 100644 --- a/src/app/modules/report-module/views/create/data.ts +++ b/src/app/modules/report-module/views/create/data.ts @@ -44,7 +44,7 @@ export interface ReportCreateViewProps { setFramesArray: React.Dispatch>; deleteFrame: (id: string) => void; framesArray: IFramesArray[]; - hasReportNameFocused: boolean; + hasSubHeaderTitleFocused: boolean; handlePersistReportState: () => void; headerDetails: { title: string; diff --git a/src/app/modules/report-module/views/create/index.tsx b/src/app/modules/report-module/views/create/index.tsx index 87288c9f0..0b3846740 100644 --- a/src/app/modules/report-module/views/create/index.tsx +++ b/src/app/modules/report-module/views/create/index.tsx @@ -113,7 +113,7 @@ function ReportCreateView(props: ReportCreateViewProps) { setHeaderDetails={props.setHeaderDetails} setReportName={props.setReportName} reportName={props.reportName} - hasReportNameFocused={props.hasReportNameFocused} + hasSubHeaderTitleFocused={props.hasSubHeaderTitleFocused} />