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

Revert "[Tableau de bord & brief] Ajout du bouton et du feature flag" #1707

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion .env.dev.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ FRONTEND_MISSION_FORM_AUTO_UPDATE=true
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_UPDATE=true
FRONTEND_DASHBOARD_ENABLED=true

################################################################################
# Version
Expand Down
1 change: 0 additions & 1 deletion .env.infra.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ FRONTEND_MISSION_FORM_AUTO_UPDATE=
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=
FRONTEND_REPORTING_FORM_AUTO_UPDATE=
FRONTEND_DASHBOARD_ENABLED=

################################################################################
# Version
Expand Down
1 change: 0 additions & 1 deletion .env.test.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ FRONTEND_MISSION_FORM_AUTO_UPDATE=true
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=true
FRONTEND_REPORTING_FORM_AUTO_UPDATE=true
FRONTEND_DASHBOARD_ENABLED=true

################################################################################
# Version
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ services:
- FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=${FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED}
- FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=${FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED}
- FRONTEND_REPORTING_FORM_AUTO_UPDATE=${FRONTEND_REPORTING_FORM_AUTO_UPDATE}
- FRONTEND_DASHBOARD_ENABLED=${FRONTEND_DASHBOARD_ENABLED}
- FRONTEND_OIDC_AUTHORITY=${MONITORENV_OIDC_ISSUER_URI}
- FRONTEND_OIDC_CLIENT_ID=${MONITORENV_OIDC_CLIENT_ID}
- FRONTEND_OIDC_ENABLED=${MONITORENV_OIDC_ENABLED}
Expand Down
1 change: 0 additions & 1 deletion frontend/.env.frontend.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ FRONTEND_MISSION_FORM_AUTO_UPDATE=
FRONTEND_MISSION_FORM_AUTO_SAVE_ENABLED=
FRONTEND_REPORTING_FORM_AUTO_SAVE_ENABLED=
FRONTEND_REPORTING_FORM_AUTO_UPDATE=
FRONTEND_DASHBOARD_ENABLED=

################################################################################
# Version
Expand Down
4 changes: 3 additions & 1 deletion frontend/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ beforeEach(() => {
// so that we can detect when the browser app is running in Cypress.
// https://docs.cypress.io/faq/questions/using-cypress-faq#How-do-I-preserve-cookies--localStorage-in-between-my-tests
cy.session('cypress', () => {
window.localStorage.setItem('IS_CYPRESS', 'true')
cy.window().then(window => {
window.localStorage.setItem('IS_CYPRESS', 'true')
})
})
})
705 changes: 389 additions & 316 deletions frontend/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"test:unit:watch": "npm run test:unit -- --watch"
},
"dependencies": {
"@mtes-mct/monitor-ui": "22.1.0",
"@mtes-mct/monitor-ui": "21.2.0",
"@reduxjs/toolkit": "2.0.0",
"@rsuite/responsive-nav": "5.0.2",
"@sentry/browser": "7.73.0",
"@sentry/react": "7.73.0",
"@sentry/tracing": "7.114.0",
"@svgr/webpack": "8.1.0",
"@tanstack/react-table": "8.20.5",
"@tanstack/react-table": "8.20.1",
"@tanstack/react-virtual": "beta",
"classnames": "2.5.1",
"dayjs": "1.11.12",
Expand Down
102 changes: 0 additions & 102 deletions frontend/src/components/Menu.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/src/components/style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Button, MapMenuDialog } from '@mtes-mct/monitor-ui'
import styled from 'styled-components'

export const Italic = styled.div`
Expand All @@ -8,22 +7,3 @@ export const Italic = styled.div`
export const Bold = styled.span`
font-weight: 700;
`

export const StyledMapMenuDialogContainer = styled(MapMenuDialog.Container)`
position: absolute;
transform: translateX(-100%);
margin-left: -6px;
display: block;
`

// TODO delete when Monitor-ui component have good padding
export const DialogButton = styled(Button)`
padding: 4px 12px;
`

export const DialogSeparator = styled.div`
height: 1px;
border-top: 1px solid ${p => p.theme.color.gainsboro};
margin-left: -12px;
margin-right: -12px;
`
4 changes: 3 additions & 1 deletion frontend/src/domain/entities/map/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export enum MapToolType {
FILTERS = 'FILTERS',
INTEREST_POINT = 'INTEREST_POINT',
MEASUREMENT = 'MEASUREMENT',
MEASUREMENT_MENU = 'MEASUREMENT_MENU'
MEASUREMENT_MENU = 'MEASUREMENT_MENU',
VESSEL_LABELS = 'VESSEL_LABELS',
VESSEL_VISIBILITY = 'VESSEL_VISIBILITY'
}

export enum OLGeometryType {
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/domain/shared_slices/Global.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// TODO This slice should disappear in favor of `features/MainWindow/slice.ts` and "Map" feature should have its own slice.
// TODO "Map" feature should have its own slice where we would transfer the related `display...` props.

import { isDashboardEnabled } from '@features/Dashboard/utils'
import { createSelector, createSlice, type PayloadAction } from '@reduxjs/toolkit'

import type { MapToolType } from '../entities/map/constants'
Expand Down Expand Up @@ -43,7 +42,6 @@ type GlobalStateType = {
displayLocateOnMap: boolean
displayMeasurement: boolean
displayInterestPoint: boolean
displayDashboard: boolean
displaySearchSemaphoreButton: boolean
displayReportingsButton: boolean
displayRightMenuControlUnitListButton: boolean
Expand Down Expand Up @@ -78,8 +76,6 @@ type GlobalStateType = {

displayStationLayer: boolean

isDashboardDialogVisible: boolean

isLayersSidebarVisible: boolean

isMapToolVisible?: MapToolType
Expand All @@ -101,7 +97,6 @@ const initialState: GlobalStateType = {
displayLocateOnMap: true,
displayMeasurement: true,
displayInterestPoint: true,
displayDashboard: true && isDashboardEnabled(),
displaySearchSemaphoreButton: true,
displayReportingsButton: true,
displayRightMenuControlUnitListButton: true,
Expand Down Expand Up @@ -140,8 +135,6 @@ const initialState: GlobalStateType = {

displayStationLayer: false,

isDashboardDialogVisible: false,

isMapToolVisible: undefined,

healthcheckTextWarning: undefined,
Expand Down Expand Up @@ -171,7 +164,6 @@ const globalSlice = createSlice({
state.isSearchSemaphoreVisible = false
state.isSearchMissionsVisible = false
state.isMapToolVisible = undefined
state.isDashboardDialogVisible = false
},

removeOverlayStroke(state) {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly FRONTEND_DASHBOARD_ENABLED: string
readonly FRONTEND_GEOSERVER_NAMESPACE: string
readonly FRONTEND_GEOSERVER_REMOTE_URL: string
readonly FRONTEND_GOOGLEMAPS_API_KEY: string
Expand Down
17 changes: 12 additions & 5 deletions frontend/src/features/Account/components/Account.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { StyledMapMenuDialogContainer } from '@components/style'
import { MenuWithCloseButton } from '@features/commonStyles/map/MenuWithCloseButton'
import { ButtonWrapper } from '@features/MainWindow/components/RightMenu/ButtonWrapper'
import { useAppDispatch } from '@hooks/useAppDispatch'
import { useAppSelector } from '@hooks/useAppSelector'
import { Accent, Button, Icon, MapMenuDialog, Size } from '@mtes-mct/monitor-ui'
import { getOIDCConfig } from 'auth/getOIDCConfig'
import { globalActions } from 'domain/shared_slices/Global'
import { useAuth } from 'react-oidc-context'
import styled from 'styled-components'

const MARGIN_TOP = 388

export function Account() {
const dispatch = useAppDispatch()
Expand All @@ -27,9 +30,9 @@ export function Account() {
}

return (
<>
<ButtonWrapper topPosition={MARGIN_TOP}>
{isAccountVisible && (
<StyledMapMenuDialogContainer>
<StyledContainer>
<MapMenuDialog.Header>
<MapMenuDialog.Title>Déconnexion</MapMenuDialog.Title>
</MapMenuDialog.Header>
Expand All @@ -43,7 +46,7 @@ export function Account() {
</Button>
</MapMenuDialog.Footer>
)}
</StyledMapMenuDialogContainer>
</StyledContainer>
)}

<MenuWithCloseButton.ButtonOnMap
Expand All @@ -54,6 +57,10 @@ export function Account() {
size={Size.LARGE}
title="Mon compte"
/>
</>
</ButtonWrapper>
)
}

const StyledContainer = styled(MapMenuDialog.Container)`
margin-right: unset;
`
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { StyledMapMenuDialogContainer } from '@components/style'
import { Accent, Icon, MapMenuDialog } from '@mtes-mct/monitor-ui'
import { useCallback, useMemo } from 'react'

Expand Down Expand Up @@ -47,7 +46,7 @@ export function ControlUnitListDialog({ onClose }: ControlUnitListDialogProps) {
}, [dispatch, displayBaseLayer])

return (
<StyledMapMenuDialogContainer style={{ height: 480 }}>
<MapMenuDialog.Container style={{ height: 480 }}>
<MapMenuDialog.Header>
<MapMenuDialog.CloseButton Icon={Icon.Close} onClick={onClose} />
<MapMenuDialog.Title>Unités de contrôle</MapMenuDialog.Title>
Expand All @@ -64,6 +63,11 @@ export function ControlUnitListDialog({ onClose }: ControlUnitListDialogProps) {
{filteredControlUnits &&
filteredControlUnits.map(controlUnit => <Item key={controlUnit.id} controlUnit={controlUnit} />)}
</MapMenuDialog.Body>
</StyledMapMenuDialogContainer>
{/* <MapMenuDialog.Footer>
<Button accent={Accent.SECONDARY} Icon={Icon.Expand} isFullWidth onClick={noop}>
Voir la vue détaillée des unités
</Button>
</MapMenuDialog.Footer> */}
</MapMenuDialog.Container>
)
}
Loading
Loading