Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add clone button to report #150

Merged
merged 5 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Minor performance improvements on report cloning
  • Loading branch information
nielsdejong committed Jun 2, 2022
commit 18edd789694a08077576cd863d9db0be950be5e1
2 changes: 1 addition & 1 deletion src/page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const NeoPage = (
<NeoCard index={index} key={getReportIndex(pagenumber, index)}
dashboardSettings={dashboardSettings}
onRemovePressed={onRemovePressed}
onClonePressed={() => {
onClonePressed={(index) => {
const { x, y } = getAddCardButtonPosition();
onClonePressed(index, x, y);
}} />
Expand Down
2 changes: 1 addition & 1 deletion src/page/PageThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const createNotificationThunk = (title: any, message: any) => (dispatch:

export const addReportThunk = (x: number, y: number, width: number, height: number, data:any) => (dispatch: any, getState: any) => {
try {
const initialState = data ? data : CARD_INITIAL_STATE;
const initialState = data !== undefined ? data : CARD_INITIAL_STATE;
const report = {...initialState, x: x, y: y, width: width, height: height};
const state = getState();
const pagenumber = state.dashboard.settings.pagenumber;
Expand Down