-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fe4ae4
commit 43454e5
Showing
5 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
frontend/src/features/Dashboard/components/DashboardForm/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import { useAppSelector } from '@hooks/useAppSelector' | ||
|
||
export function DashboardForm() { | ||
const extractedArea = useAppSelector(state => state.dashboard.extractedArea) | ||
|
||
return ( | ||
<div> | ||
<h1>Dashboard Form</h1> | ||
{JSON.stringify(extractedArea)} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
frontend/src/features/Dashboard/useCases/closeDashboard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { globalActions } from 'domain/shared_slices/Global' | ||
|
||
import { dashboardActions } from '../slice' | ||
|
||
import type { HomeAppThunk } from '@store/index' | ||
|
||
export const GET_EXTRACTED_AREAS_ERROR_MESSAGE = "Nous n'avons pas pu créer le tableau de bord" | ||
|
||
export const closeDashboard = (): HomeAppThunk => dispatch => { | ||
resetDrawing() | ||
closeMenuDialog() | ||
|
||
function closeMenuDialog() { | ||
dispatch(globalActions.setDisplayedItems({ isDashboardDialogVisible: false })) | ||
} | ||
|
||
function resetDrawing() { | ||
dispatch(dashboardActions.setIsDrawing(false)) | ||
dispatch(dashboardActions.setGeometry({ coordinates: [], type: 'MultiPolygon' })) | ||
} | ||
} |
15 changes: 12 additions & 3 deletions
15
frontend/src/features/Dashboard/useCases/createDashboard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters