Skip to content

Commit

Permalink
Merge branch 'develop' into ocvrs-7906
Browse files Browse the repository at this point in the history
  • Loading branch information
tumbledwyer authored Nov 22, 2024
2 parents 29af532 + e7c976b commit 51c50fc
Show file tree
Hide file tree
Showing 96 changed files with 1,694 additions and 1,353 deletions.
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ services:
- base
environment:
- COUNTRY_CONFIG_URL_INTERNAL=http://countryconfig:3040

events:
image: opencrvs/ocrvs-events:${VERSION}
#platform: linux/amd64
build:
context: .
dockerfile: ./packages/events/Dockerfile
restart: unless-stopped
depends_on:
- base

gateway:
image: opencrvs/ocrvs-gateway:${VERSION}
#platform: linux/amd64
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/nock": "^10.0.3",
"@types/pdfmake": "^0.2.0",
"@types/react-redux": "^7.1.5",
"@types/react-router": "^5.1.2",
"@types/react-router-dom": "^5.1.2",
"@types/react-tooltip": "^4.2.4",
"@types/redux-sentry-middleware": "^0.2.0",
"@types/styled-components": "^5.1.3",
Expand Down Expand Up @@ -86,7 +86,7 @@
"react-intl": "5.25.1",
"react-page-visibility": "^3.2.1",
"react-redux": "^7.1.1",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"react-stickynode": "^2.0.1",
"react-tooltip": "^4.2.21",
"react-transition-group": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { ConnectedRouter } from 'connected-react-router'
import { History, Location } from 'history'
import * as React from 'react'
import { Provider } from 'react-redux'
import { Route, Switch } from 'react-router'
import { Route, Switch } from 'react-router-dom'
import { AppStore } from './store'
import { CorrectionForm, CorrectionReviewForm } from './views/CorrectionForm'
import { VerifyCorrector } from './views/CorrectionForm/VerifyCorrector'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
import * as React from 'react'
import { injectIntl, WrappedComponentProps as IntlShapeProps } from 'react-intl'
import { connect } from 'react-redux'
import { RouteComponentProps, withRouter } from 'react-router'
import { RouteComponentProps, withRouter } from 'react-router-dom'
import { TEAM_USER_LIST } from '@client/navigation/routes'
import { setAdvancedSearchParam } from '@client/search/advancedSearch/actions'
import { advancedSearchInitialState } from '@client/search/advancedSearch/reducer'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/Header/HistoryNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
import React from 'react'
import { Button } from '@opencrvs/components/lib/Button'
import { useHistory } from 'react-router'
import { useHistory } from 'react-router-dom'
import { useDispatch, useSelector } from 'react-redux'
import { getUserDetails } from '@client/profile/profileSelectors'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
import * as React from 'react'
import { connect } from 'react-redux'
import { withRouter, RouteComponentProps } from 'react-router'
import { withRouter, RouteComponentProps } from 'react-router-dom'
import { messages } from '@client/i18n/messages/views/notifications'
import { userMessages } from '@client/i18n/messages/user'
import { WrappedComponentProps as IntlShapeProps, injectIntl } from 'react-intl'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
import * as React from 'react'
import styled from 'styled-components'
import { RouteComponentProps, withRouter } from 'react-router'
import { RouteComponentProps, withRouter } from 'react-router-dom'
import { connect } from 'react-redux'
import { IStoreState } from '@opencrvs/client/src/store'
import { setInitialDeclarations } from '@client/declarations'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/ProtectedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as React from 'react'
import PageVisibility from 'react-page-visibility'
import { Unlock } from '@client/views/Unlock/Unlock'
import { storage } from '@client/storage'
import { withRouter, RouteComponentProps } from 'react-router'
import { withRouter, RouteComponentProps } from 'react-router-dom'
import { isMobileDevice } from '@client/utils/commonUtils'
import IdleTimer from 'react-idle-timer'
import { USER_DETAILS, UserDetails } from '@client/utils/userUtils'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import * as React from 'react'
import { Redirect, Route } from 'react-router'
import { Redirect, Route } from 'react-router-dom'
import { connect } from 'react-redux'
import { IStoreState } from '@client/store'
import { getAuthenticated } from '@client/profile/profileSelectors'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/ScrollToTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import React, { useEffect, ReactNode } from 'react'
import { withRouter, RouteComponentProps } from 'react-router'
import { withRouter, RouteComponentProps } from 'react-router-dom'

type ScrollToTopProps = RouteComponentProps & { children?: ReactNode }

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/TransitionWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PAGE_TRANSITIONS_EXIT_TIME
} from '@client/utils/constants'
import * as routes from '@client/navigation/routes'
import { matchPath } from 'react-router'
import { matchPath } from 'react-router-dom'
import { Location } from 'history'

function isPathExactmatch(pathname: string, routesPath: string): boolean {
Expand Down
43 changes: 24 additions & 19 deletions packages/client/src/components/charts/RegRatesLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,6 @@ interface IProps extends WrappedComponentProps {
completenessRateTime?: CompletenessRateTime
}

interface IActiveState {
value: number
stroke: string
}
interface IState {
legendMarginTop: number
legendMarginLeft: number
chartTop: number
chartRight: number
chartBottom: number
chartLeft: number
maximizeXAxisInterval?: boolean
legendLayout: LegendProps['layout']
activeLabel: string
activeRegisteredInTargetDays: IActiveState
activeTotalRegistered: IActiveState
activeTotalEstimate: IActiveState
}

const CustomLegendContainer = styled.div<{
marginLeft: number
marginTop: number
Expand Down Expand Up @@ -123,6 +104,26 @@ interface ILineDataPoint {
registrationPercentage: string
}

interface IActiveState {
value: number
stroke: string
}

interface IState {
legendMarginTop: number
legendMarginLeft: number
chartTop: number
chartRight: number
chartBottom: number
chartLeft: number
maximizeXAxisInterval?: boolean
legendLayout: LegendProps['layout']
activeLabel: string
activeRegisteredInTargetDays: IActiveState
activeTotalRegistered: IActiveState
activeTotalEstimate: IActiveState
}

function LegendDot(props: React.HTMLAttributes<SVGElement>) {
return (
<svg width={10} height={10} viewBox="0 0 10 10" fill="none" {...props}>
Expand All @@ -146,6 +147,7 @@ const RegRatesLineChartComponent = (props: IProps) => {
legendLayout: 'horizontal' as const
}
}

const getStatePropertiesForLargeWindowChart = () => {
return {
legendMarginTop: -16,
Expand Down Expand Up @@ -292,6 +294,7 @@ const RegRatesLineChartComponent = (props: IProps) => {
)
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const customizedTooltip = (dataPoint: any) => {
const wrapperPayload = dataPoint.payload[0]

Expand All @@ -304,6 +307,7 @@ const RegRatesLineChartComponent = (props: IProps) => {
)
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mouseMoveHandler = (data: any) => {
if (data && data.activePayload) {
setState({
Expand Down Expand Up @@ -466,6 +470,7 @@ const RegRatesLineChartComponent = (props: IProps) => {
/>
)
}

return getLoadingIndicator()
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/form/Redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getOfflineData } from '@client/offline/selectors'
import { getUserDetails } from '@client/profile/profileSelectors'
import React from 'react'
import { useSelector } from 'react-redux'
import { Redirect } from 'react-router'
import { Redirect } from 'react-router-dom'

export const RedirectField = ({
to,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/components/interface/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { omit } from 'lodash'
import * as React from 'react'
import { injectIntl, WrappedComponentProps as IntlShapeProps } from 'react-intl'
import { connect } from 'react-redux'
import { RouteComponentProps, withRouter } from 'react-router'
import { RouteComponentProps, withRouter } from 'react-router-dom'
import { IS_PROD_ENVIRONMENT } from '@client/utils/constants'

const SCREEN_LOCK = 'screenLock'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ vi.mock('./utils', async () => ({
getUserRole: vi.fn().mockImplementation((lang, role) => 'ENTREPENEUR')
}))

vi.mock('react-router', async () => ({
...((await vi.importActual('react-router')) as any),
vi.mock('react-router-dom', async () => ({
...((await vi.importActual('react-router-dom')) as any),
useParams: vi.fn().mockImplementation(() => ({
event: 'birth',
section: 'child'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/tests/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import { waitForElement } from './wait-for-element'
import { setUserDetails } from '@client/profile/profileActions'
import { createLocation, createMemoryHistory, History } from 'history'
import { stringify } from 'query-string'
import { match as Match } from 'react-router'
import { match as Match } from 'react-router-dom'
import { ConnectedRouter } from 'connected-react-router'
import { mockOfflineData } from './mock-offline-data'
import { Section, SubmissionAction } from '@client/forms'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { messages as advancedSearchResultMessages } from '@client/i18n/messages/
import { SearchEventsQuery } from '@client/utils/gateway'
import { Frame } from '@opencrvs/components/lib/Frame'
import { LoadingIndicator } from '@client/views/OfficeHome/LoadingIndicator'
import { Redirect, RouteComponentProps } from 'react-router'
import { Redirect, RouteComponentProps } from 'react-router-dom'
import { ErrorText, Link, Pill } from '@client/../../components/lib'
import { WQContentWrapper } from '@client/views/OfficeHome/WQContentWrapper'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import * as React from 'react'
import { connect } from 'react-redux'
import { IStoreState } from '@client/store'
import { Redirect, RouteComponentProps } from 'react-router'
import { Redirect, RouteComponentProps } from 'react-router-dom'
import { IDeclaration, modifyDeclaration } from '@client/declarations'
import {
CorrectorForm,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/views/CorrectionForm/ReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CERTIFICATE_CORRECTION_REVIEW, HOME } from '@client/navigation/routes'
import { connect } from 'react-redux'
import { getEventReviewForm } from '@client/forms/register/review-selectors'
import { Event } from '@client/utils/gateway'
import { Redirect } from 'react-router'
import { Redirect } from 'react-router-dom'

type IStateProps = {
declaration: IDeclaration | undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import * as React from 'react'
import { WrappedComponentProps as IntlShapeProps, injectIntl } from 'react-intl'
import { connect } from 'react-redux'
import { Redirect, RouteComponentProps } from 'react-router'
import { Redirect, RouteComponentProps } from 'react-router-dom'
import {
CERTIFICATE_CORRECTION_REVIEW,
REGISTRAR_HOME_TAB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Button } from '@opencrvs/components/lib/Button'
import { constantsMessages } from '@client/i18n/messages'
import { useIntl } from 'react-intl'
import { HistoryNavigator } from '@client/components/Header/HistoryNavigator'
import { Redirect, useParams } from 'react-router'
import { Redirect, useParams } from 'react-router-dom'
import { IPrintableDeclaration } from '@client/declarations'
import { useDispatch } from 'react-redux'
import { useDeclaration } from '@client/declarations/selectors'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import { replaceInitialValues } from '@client/views/RegisterForm/RegisterForm'
import { issueMessages } from '@client/i18n/messages/issueCertificate'
import { getIssueCertCollectorGroupForEvent } from '@client/forms/certificate/fieldDefinitions/collectorSection'
import { Redirect } from 'react-router'
import { Redirect } from 'react-router-dom'
import { REGISTRAR_HOME_TAB } from '@client/navigation/routes'
import { WORKQUEUE_TABS } from '@client/components/interface/Navigation'
import { getOfflineData } from '@client/offline/selectors'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
collectMarriageCertificateFormSection
} from '@client/forms/certificate/fieldDefinitions/collectorSection'
import { Event } from '@client/utils/gateway'
import { Redirect } from 'react-router'
import { Redirect } from 'react-router-dom'
import { REGISTRAR_HOME_TAB } from '@client/navigation/routes'
import { WORKQUEUE_TABS } from '@client/components/interface/Navigation'
import { getOfflineData } from '@client/offline/selectors'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import * as React from 'react'
import { Mock, vi } from 'vitest'
import { IssuePayment } from './IssuePayment'
import { storeDeclaration } from '@client/declarations'
import { useParams } from 'react-router'
import { useParams } from 'react-router-dom'

const getItem = window.localStorage.getItem as Mock
;(queries.fetchUserDetails as Mock).mockReturnValue(mockUserResponse)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
import { formatUrl, goBack, goToHomeTab } from '@client/navigation'
import { useIntl } from 'react-intl'
import * as React from 'react'
import { Redirect, useParams } from 'react-router'
import { Redirect, useParams } from 'react-router-dom'
import { REGISTRAR_HOME_TAB } from '@client/navigation/routes'
import { WORKQUEUE_TABS } from '@client/components/interface/Navigation'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/views/OfficeHome/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getUserDetails } from '@client/profile/profileSelectors'
import * as React from 'react'
import { useSelector } from 'react-redux'
import { PERFORMANCE_HOME, REGISTRAR_HOME } from '@client/navigation/routes'
import { Redirect } from 'react-router'
import { Redirect } from 'react-router-dom'
import { getDefaultPerformanceLocationId } from '@client/navigation'
import { UserDetails } from '@client/utils/userUtils'
import {
Expand Down
14 changes: 8 additions & 6 deletions packages/client/src/views/OfficeHome/OfficeHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { Toast } from '@opencrvs/components/lib/Toast'
import * as React from 'react'
import { injectIntl, WrappedComponentProps as IntlShapeProps } from 'react-intl'
import { connect } from 'react-redux'
import { RouteComponentProps } from 'react-router'
import { Link, RouteComponentProps } from 'react-router-dom'
import { SentForReview } from './sentForReview/SentForReview'
import { InProgress, SELECTOR_ID } from './inProgress/InProgress'
import { ReadyToPrint } from './readyToPrint/ReadyToPrint'
Expand All @@ -61,6 +61,7 @@ import { ReadyToIssue } from './readyToIssue/ReadyToIssue'
import { getOfflineData } from '@client/offline/selectors'
import { IOfflineData } from '@client/offline/reducer'
import { Event } from '@client/utils/gateway'
import { SELECT_VITAL_EVENT } from '@client/navigation/routes'

const FABContainer = styled.div`
position: fixed;
Expand Down Expand Up @@ -456,11 +457,12 @@ class OfficeHomeView extends React.Component<
)}

<FABContainer>
<FloatingActionButton
id="new_event_declaration"
onClick={this.props.goToEvents}
icon={() => <PlusTransparentWhite />}
/>
<Link to={SELECT_VITAL_EVENT}>
<FloatingActionButton
id="new_event_declaration"
icon={() => <PlusTransparentWhite />}
/>
</Link>
</FABContainer>

{this.state.showCertificateToast && (
Expand Down
Loading

0 comments on commit 51c50fc

Please sign in to comment.