Skip to content

Commit

Permalink
fix: rename subheader title variable
Browse files Browse the repository at this point in the history
  • Loading branch information
okorie2 committed Oct 30, 2023
1 parent 66939c3 commit 59de222
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/common/subheader-toolbar/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import useDebounce from "react-use/lib/useDebounce";

interface Props {
previewMode: boolean;
hasReportNameFocused?: boolean;
hasSubHeaderTitleFocused?: boolean;
setReportName?: React.Dispatch<React.SetStateAction<string>>;
reportName?: string;
headerDetails: {
Expand Down Expand Up @@ -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);
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ export default function RowFrame(props: RowFrameProps) {
});
};

console.log(props.framesArray, "framesarray");

React.useEffect(() => {
setSelectedType(selectedTypeHistory[selectedTypeHistory.length - 1]);
}, [selectedTypeHistory]);
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/report-module/views/create/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface ReportCreateViewProps {
setFramesArray: React.Dispatch<React.SetStateAction<IFramesArray[]>>;
deleteFrame: (id: string) => void;
framesArray: IFramesArray[];
hasReportNameFocused: boolean;
hasSubHeaderTitleFocused: boolean;
handlePersistReportState: () => void;
headerDetails: {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/report-module/views/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function ReportCreateView(props: ReportCreateViewProps) {
setHeaderDetails={props.setHeaderDetails}
setReportName={props.setReportName}
reportName={props.reportName}
hasReportNameFocused={props.hasReportNameFocused}
hasSubHeaderTitleFocused={props.hasSubHeaderTitleFocused}
/>
<Container maxWidth="lg">
<div
Expand Down

0 comments on commit 59de222

Please sign in to comment.