From eff96f9e5ee9aa4b12626ae9ccfb28a1d36f8d0b Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 20 Nov 2019 13:45:54 +0100 Subject: [PATCH 1/3] fix mapping screen crash when office/resource is unknown --- .../components/SingleMapping.js | 116 +++++++++--------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js b/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js index 2e7d36d..61daa4a 100644 --- a/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js +++ b/client/src/scenes/RoomOfficeNameMapping/components/SingleMapping.js @@ -76,67 +76,71 @@ class SingleMapping extends Component { }; render() { - const { singleMapping: { officeSlug, resourceSlug } } = this.props; - const { officeId, resourceId, officeOptions, allResourceOptions, pendingMappings } = this.props; - const { showDeletePrompt, newOfficeId, newResourceId } = this.state; + try { + const {singleMapping: {officeSlug, resourceSlug}} = this.props; + const {officeId, resourceId, officeOptions, allResourceOptions, pendingMappings} = this.props; + const {showDeletePrompt, newOfficeId, newResourceId} = this.state; - const selectedOfficeId = newOfficeId ? newOfficeId : officeId; - const selectedResourceId = newResourceId ? newResourceId : resourceId; + const selectedOfficeId = newOfficeId ? newOfficeId : officeId; + const selectedResourceId = newResourceId ? newResourceId : resourceId; - const resourceOptions = allResourceOptions && officeId ? allResourceOptions[selectedOfficeId].roomOptions : []; + const resourceOptions = allResourceOptions && officeId ? allResourceOptions[selectedOfficeId].roomOptions : []; - const enableActions = !pendingMappings; - const enableSave = enableActions && ((newOfficeId !== null) || (newResourceId !== null)); - const saveIconColor = enableSave ? 'green' : null; + const enableActions = !pendingMappings; + const enableSave = enableActions && ((newOfficeId !== null) || (newResourceId !== null)); + const saveIconColor = enableSave ? 'green' : null; - return ( - - - - - - - + - - - - - - - - - - ); + + + + + + + + + + + + + + + ); + }catch (e) { + return null; + } } } -- 2.47.3 From c0c4c1f4a1a88e75265aff3f874e491d2ccd3ed1 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 20 Nov 2019 13:46:12 +0100 Subject: [PATCH 2/3] add door unlock/lock time column to the incidents table --- client/src/constants/constants.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/constants/constants.js b/client/src/constants/constants.js index 22e9725..dca00cb 100644 --- a/client/src/constants/constants.js +++ b/client/src/constants/constants.js @@ -1,3 +1,5 @@ +export const CONTAINER_WIDTH_PERCENTAGE = 90; + export const defaultDateFormat = 'YYYY-MM-DD'; export const doorLockRelatedWithReservationIncidentHeaders = [ @@ -5,6 +7,7 @@ export const doorLockRelatedWithReservationIncidentHeaders = [ 'resourceName', 'memberName', 'reservation', + 'doorLockTimestamps', 'incidentType', 'feeDescription', 'totalChargeFee' -- 2.47.3 From cd79a47462c90114eb4e04e93e69a5853124f901 Mon Sep 17 00:00:00 2001 From: Bilal Catic Date: Wed, 20 Nov 2019 13:46:41 +0100 Subject: [PATCH 3/3] set main container width configurable --- client/src/scenes/Home/index.js | 3 ++- client/src/scenes/IncidentsReport/index.js | 3 ++- client/src/scenes/MemberPracticeSummaryReport/index.js | 3 ++- client/src/scenes/RoomOfficeNameMapping/index.js | 3 ++- client/src/scenes/SpecificMemberIncidentsReport/index.js | 3 ++- client/src/scenes/UploadDLockData/index.js | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/src/scenes/Home/index.js b/client/src/scenes/Home/index.js index 21c2698..33d192c 100644 --- a/client/src/scenes/Home/index.js +++ b/client/src/scenes/Home/index.js @@ -4,12 +4,13 @@ import { Container, Message } from 'semantic-ui-react'; import MainMenu from '../../components/MainMenu'; import { mainMenuItems } from '../../constants/menuItems'; +import {CONTAINER_WIDTH_PERCENTAGE} from "../../constants/constants"; class Home extends Component { render () { return ( - +

SIMA SPACE


diff --git a/client/src/scenes/IncidentsReport/index.js b/client/src/scenes/IncidentsReport/index.js index 951e642..891f87a 100644 --- a/client/src/scenes/IncidentsReport/index.js +++ b/client/src/scenes/IncidentsReport/index.js @@ -8,6 +8,7 @@ import MemberIncidentsTables from '../../components/MemberIncidentsTables'; import GenerateFeesInORDButton from '../../components/GenerateFeesInORDButton'; import { fetchIncidents } from '../../store/actions'; +import { CONTAINER_WIDTH_PERCENTAGE } from '../../constants/constants'; class IncidentsReport extends Component { state = {dateRange: null}; @@ -33,7 +34,7 @@ class IncidentsReport extends Component { } return ( - +

Incidents Report


diff --git a/client/src/scenes/MemberPracticeSummaryReport/index.js b/client/src/scenes/MemberPracticeSummaryReport/index.js index fcec497..aaba9ad 100644 --- a/client/src/scenes/MemberPracticeSummaryReport/index.js +++ b/client/src/scenes/MemberPracticeSummaryReport/index.js @@ -5,6 +5,7 @@ import { Container, Button, Loader, Input, Message, Grid } from 'semantic-ui-rea import MainMenu from '../../components/MainMenu'; import { fetchMemberPracticeSummaryReport } from '../../store/actions'; +import {CONTAINER_WIDTH_PERCENTAGE} from "../../constants/constants"; class MemberPracticeSummaryReport extends Component { @@ -54,7 +55,7 @@ class MemberPracticeSummaryReport extends Component { error = fetchReportError ? fetchReportError : error; return ( - +

Member Practice Summary Report


diff --git a/client/src/scenes/RoomOfficeNameMapping/index.js b/client/src/scenes/RoomOfficeNameMapping/index.js index 19fa6ec..6b36438 100644 --- a/client/src/scenes/RoomOfficeNameMapping/index.js +++ b/client/src/scenes/RoomOfficeNameMapping/index.js @@ -5,6 +5,7 @@ import { Container, Message, Loader, Table } from 'semantic-ui-react'; import MainMenu from '../../components/MainMenu'; import { fetchMappings } from '../../store/actions'; import SingleMapping from './components/SingleMapping'; +import {CONTAINER_WIDTH_PERCENTAGE} from "../../constants/constants"; class RoomOfficeNameMapping extends Component { @@ -47,7 +48,7 @@ class RoomOfficeNameMapping extends Component { }); return ( - +

Room Office Mapping

diff --git a/client/src/scenes/SpecificMemberIncidentsReport/index.js b/client/src/scenes/SpecificMemberIncidentsReport/index.js index 0ed11bd..5e1c0fb 100644 --- a/client/src/scenes/SpecificMemberIncidentsReport/index.js +++ b/client/src/scenes/SpecificMemberIncidentsReport/index.js @@ -10,6 +10,7 @@ import MemberIncidentsTables from '../../components/MemberIncidentsTables'; import GenerateFeesInORDButton from '../../components/GenerateFeesInORDButton'; import { fetchMemberIncidents } from '../../store/actions'; +import {CONTAINER_WIDTH_PERCENTAGE} from "../../constants/constants"; class SpecificMemberIncidentsReport extends Component { constructor(props){ @@ -48,7 +49,7 @@ class SpecificMemberIncidentsReport extends Component { const addFeesButtonDisabled = !memberId || !dateRange || loading; return ( - +

Member Incidents Report


diff --git a/client/src/scenes/UploadDLockData/index.js b/client/src/scenes/UploadDLockData/index.js index 8d245c8..8aedf72 100644 --- a/client/src/scenes/UploadDLockData/index.js +++ b/client/src/scenes/UploadDLockData/index.js @@ -4,10 +4,11 @@ import { Container, Form } from 'semantic-ui-react'; import MainMenu from '../../components/MainMenu'; import FileUpload from './components/FileUpload'; import UploadResults from './components/UploadResults'; +import {CONTAINER_WIDTH_PERCENTAGE} from "../../constants/constants"; function UploadDLockData() { return ( - +

DLock Data


-- 2.47.3