-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: case floor plan pins editing (#881)
* feat: case floor plan pins editing * feat: allow to add floor plan pins to a case after creation * fix: prevent saving same pins set as new floor plan comment * feat: refactor floor plan renderer/editor to component * fix: revert sync issue with associated mongo documents * feat: upload floor plan from case views; add pins to case after creation
- Loading branch information
1 parent
32336b8
commit 5e6a62d
Showing
14 changed files
with
532 additions
and
271 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
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
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
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
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,15 @@ | ||
// @flow | ||
export const CHANGE_FLOOR_PLAN_PINS = 'change_floor_plan_pins_for_case' | ||
|
||
type FloorPlanPins = Array<{ | ||
x: number, | ||
y: number | ||
}> | ||
export function changeFloorPlanPins (caseId: number, floorPlanPins: FloorPlanPins, floorPlanId: number) { | ||
return { | ||
type: CHANGE_FLOOR_PLAN_PINS, | ||
caseId, | ||
floorPlanPins, | ||
floorPlanId | ||
} | ||
} |
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,16 @@ | ||
import { collectionName } from '../../api/comments' | ||
|
||
import fallibleMethodCaller from './base/fallible-method-caller' | ||
import { genericErrorOccurred } from '../../ui/general-actions' | ||
import { CHANGE_FLOOR_PLAN_PINS } from '../actions/case-floor-plan-pins.actions' | ||
|
||
export const changeCaseFloorPlanPins = fallibleMethodCaller({ | ||
actionType: CHANGE_FLOOR_PLAN_PINS, | ||
methodName: `${collectionName}.insertFloorPlan`, | ||
argTranslator: ({ caseId, floorPlanPins, floorPlanId }) => [parseInt(caseId), floorPlanPins, floorPlanId], | ||
actionGenerators: { | ||
errorGen: (err, { caseId }) => genericErrorOccurred( | ||
`Failed to update case's floor plan pins for case ${caseId} due to: "${err.error}"` | ||
) | ||
} | ||
}) |
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
Oops, something went wrong.