**Created Date**: 08-10-2020

**Author**: Vivek P.S

**Framework**: reactJS 16.8.5

**Description** : 

There are two instances for this project in staging server. The urls are;
1. http://idesigner.stplc.info/
2. http://devidesigner.stplc.info/
This project is configured in Jenkins. When developers merges code to staging branch and run a build in jenkins server, the new code change will be automatically deployed to staging server.

**Account manager** : Rony Sebastian

**Team members** : Nibin Paul(dev), Bibin (dev),Alrin A Jabin(dev), Anand(dev), Thilak(QA), Edwin(QA)

**Technologies used** : reactJS 16.8.5

**IDE** : Visual Studio Code

**Third-party libraries** : 

| Library | Version |
| ------ | ------ |
| three |  0.94.x |
| react-dom | 16.8.5 |
| mapbox/react-range | 0.0.7 |
| area-polygon | 1.0.1 |
| convert-units | 2.3.4 |
| cors | ^2.8.5 |
| express | ^4.17.1 |
| file-system | ^2.2.2 |
| fs | 0.0.1-security |
| html-webpack-plugin | 3.2.0 |
| immutable | 3.8.2 |
| immutablediff | 0.4.4 |
| immutablepatch | 0.5.0 |
| mathjs | ^7.0.1 |
| mysql | ^2.17.1 |
| polylabel | 1.0.2 |
| prop-types | 15.7.2 |
| react-app-polyfill | ^1.0.4 |
| react-bootstrap | ^1.0.0-beta.14 |
| react-color | ^2.17.3 |
| react-fileupload-progress | ^0.5.0 |
| react-flash-message | ^1.0.2 |
| react-icons | 3.5.0 |
| react-pdf | ^4.1.0 |
| react-pdf-to-image | ^1.0.2 |
| react-redux | 5.0.7 |
| react-svg-pan-zoom | 2.18.0 |
| react-tabs | 3.0.0 |
| react-to-print | ^2.5.0 |
| redux | 4.0.1 |
| redux-thunk | ^2.3.0 |
| save-svg-as-png | ^1.4.14 |
| shortid | 2.2.14 |
| xml-js | ^1.6.11 |

**Prototype URL** – Not Created

**Documents Location** - https://drive.google.com/drive/folders/1-4NyTgJGUrneb_hGl8Bhh34cl9raLiMg?usp=sharing

**To configure this Project** :
- Run the command "npm install" from root directory. This will install all the necessary packages for the application.
- There will be a configuration file named "constants.js" in root directory there we can set API URL.
- Run the command "npm start" from root directory to start the Project.





      // let doorsList = layer.getIn(['holes']).filter((p) => (line.holes.includes(p.id) && (p.type == 'door') ));
      // doorsList = _.orderBy(doorsList.toArray(), ['offset'], ['asc'])
      // if (doorsList.length > 0) {
      //   doorsList.forEach((door, index) => {
      //     // let doorStartOffset = toFixedFloat(door.offset - (door.properties.getIn(['width', 'length']) / (lineLength * 2)))
      //     // let doorEndOffset = toFixedFloat(door.offset + (door.properties.getIn(['width', 'length']) / (lineLength * 2)))
      //     // let doorAttchPanel = []
      //     let doorAttchPanel = Hole.getHoleResidingPanels(state.scene, layerID, door.id);
      //     console.log(doorAttchPanel, "dddd")
      //      if(doorAttchPanel.length>0){
      //   if(doorAttchPanel.length>1){
      //     let paWidth = 121.92;
      //     let firstPanelStartOffset = toFixedFloat(doorAttchPanel[0].offset - (paWidth / (lineLength * 2)))
      //     let firstPanelEndOffset = toFixedFloat(doorAttchPanel[0].offset + (paWidth / (lineLength * 2)))
      //     let lastPanelStartOffset = toFixedFloat(doorAttchPanel[doorAttchPanel.length-1].offset - (paWidth / (lineLength * 2)))
      //     let lastPanelEndOffset = toFixedFloat(doorAttchPanel[doorAttchPanel.length-1].offset + (paWidth / (lineLength * 2)))
      //     // if(firstPanelStartOffset>doorStartOffset&&doorEndOffset<lastPanelEndOffset){
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelStartOffset) })
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(lastPanelEndOffset) })
      //     // }
      //   }else{
      //     let paWidth = 121.92;
      //     let firstPanelStartOffset = toFixedFloat(doorAttchPanel[0].offset - (paWidth / (lineLength * 2)))
      //     let firstPanelEndOffset = toFixedFloat(doorAttchPanel[0].offset + (paWidth / (lineLength * 2)))
      //     // if(firstPanelStartOffset>doorStartOffset&&doorEndOffset<firstPanelEndOffset){
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelStartOffset) })
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelEndOffset) })
      //     // }
      // }
      // }

      // let lockedDistance = holePanel.offset * lineLength;
      // console.log(lockedDistance, lineLength, "test")
      // let width = holePanel.properties.getIn(['width', 'length']);
      // let lockedStartOffset = toFixedFloat(toFixedFloat(lockedDistance) / lineLength - width / (lineLength * 2))
      // let lockedEndOffset = toFixedFloat(toFixedFloat(lockedDistance) / lineLength + width / (lineLength * 2))
      // if (startOffset <= lockedStartOffset && lockedEndOffset < endOffset) {
      //   let preCompWidth = hpostInnerWidth
      //   let prevHpostRaceway = findNearestOffsetPanel(lineHpostsRaceways, lockedStartOffset);
      //   if (prevHpostRaceway && prevHpostRaceway.type == 'raceways') {
      //     preCompWidth = raceWayInnerWidth;
      //   }
      //   console.log((preCompWidth / (lineLength)), "(preCompWidth / (lineLength))")
      //   lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(lockedStartOffset - ((preCompWidth / (lineLength)))), checkstatus: true })
      //   lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(lockedEndOffset + ((preCompWidth / (lineLength)))), checkstatus: true })
      // }
      //     let vStartOffset = toFixedFloat(holePanel.offset - (holePanel.properties.getIn(['width', 'length']) / (lineLength * 2)))
      // let vEndOffset = toFixedFloat(holePanel.offset + (holePanel.properties.getIn(['width', 'length']) / (lineLength * 2)))
      // lineBreakOffsetArray.push({ type: 'lockedPanel', offset: toFixedFloat(lockedStartOffset) })
      // lineBreakOffsetArray.push({ type: 'lockedPanel', offset: toFixedFloat(lockedEndOffset) })

      //   })
      // }
















      // let lockedStartOffset = toFixedFloat(toFixedFloat(lockedDistance) / lineLength - width / (lineLength * 2))
      // let lockedEndOffset = toFixedFloat(toFixedFloat(lockedDistance) / lineLength + width / (lineLength * 2))
      // if (Math.abs(startOffset - lockedStartOffset) < (1 / lineLength) && lockedEndOffset < endOffset ) {
      //   lineBreakOffsetArray[0].type = 'lockedPanel';
      // }
      // else if (startOffset <= lockedStartOffset && lockedEndOffset < endOffset) {
      //   let preCompWidth = hpostInnerWidth
      //   let prevHpostRaceway = findNearestOffsetPanel(lineHpostsRaceways, lockedStartOffset);
      //   if (prevHpostRaceway && prevHpostRaceway.type == 'raceways') {
      //     preCompWidth = raceWayInnerWidth;
      //   }
      //   lineBreakOffsetArray.push({ type: 'lockedPanel', offset: toFixedFloat(lockedStartOffset - ((preCompWidth / (lineLength)))) })
      //   lineBreakOffsetArray.push({ type: 'lockedPanel', offset: toFixedFloat(lockedEndOffset - ((preCompWidth / (lineLength)))) })

      // }


      // let vStartOffset = toFixedFloat(holePanel.offset - (holePanel.properties.getIn(['width', 'length']) / (lineLength * 2)))
      // let vEndOffset = toFixedFloat(holePanel.offset + (holePanel.properties.getIn(['width', 'length']) / (lineLength * 2)))


      // if (startOffset < vStartOffset && vEndOffset < endOffset) {
      //   lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(vStartOffset) })
      // } else if (startOffset < vStartOffset && vEndOffset < endOffset) {
      //   lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(vEndOffset) })
      // }






      // linePanels.forEach((panel, index) => {
      //   let paWidth = panel.properties.getIn(['width', 'length']);
      //   let PanelStartOffset = toFixedFloat(panel.offset - (paWidth / (lineLength * 2)))
      //   let PanelEndOffset = toFixedFloat(panel.offset + (paWidth / (lineLength * 2)))

      //   // if(PanelStartOffset<doorStartOffset && doorEndOffset <  PanelEndOffset){
      //   // // if (panel.offset >doorStartOffset&& panel.offset < doorEndOffset) {|| doorStartOffset>PanelStartOffset && PanelEndOffset<doorEndOffset
      //   //   doorAttchPanel.push(panel)
      //   // }

      //   // if(PanelStartOffset<doorStartOffset &&PanelEndOffset<doorEndOffset && PanelEndOffset> doorStartOffset   ){
      //   //   doorAttchPanel.push(panel)&& doorStartOffset>PanelStartOffset &seekOffset& PanelStartOffset<doorEndOffset
      //   // }

      //   if(doorEndOffset > PanelEndOffset ){
      //     console.log(doorEndOffset,PanelEndOffset,doorStartOffset,PanelStartOffset,"osffesr")
      //     doorAttchPanel.push(panel)
      //   }
      // })

      // console.log(doorStartOffset,doorEndOffset,doorAttchPanel,"doorAttchPanel")


      // if(doorAttchPanel.length>0){
      //   if(doorAttchPanel.length>1){
      //     let paWidth = doorAttchPanel[0].properties.getIn(['width', 'length']);
      //     let firstPanelStartOffset = toFixedFloat(doorAttchPanel[0].offset - (paWidth / (lineLength * 2)))
      //     let firstPanelEndOffset = toFixedFloat(doorAttchPanel[0].offset + (paWidth / (lineLength * 2)))
      //     let lastPanelStartOffset = toFixedFloat(doorAttchPanel[doorAttchPanel.length-1].offset - (paWidth / (lineLength * 2)))
      //     let lastPanelEndOffset = toFixedFloat(doorAttchPanel[doorAttchPanel.length-1].offset + (paWidth / (lineLength * 2)))
      //     if(firstPanelStartOffset>doorStartOffset&&doorEndOffset<lastPanelEndOffset){
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelStartOffset) })
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(lastPanelEndOffset) })
      //     }
      //   }else{
      //     let paWidth = doorAttchPanel[0].properties.getIn(['width', 'length']);
      //     let firstPanelStartOffset = toFixedFloat(doorAttchPanel[0].offset - (paWidth / (lineLength * 2)))
      //     let firstPanelEndOffset = toFixedFloat(doorAttchPanel[0].offset + (paWidth / (lineLength * 2)))
      //     if(firstPanelStartOffset>doorStartOffset&&doorEndOffset<firstPanelEndOffset){
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelStartOffset) })
      //       lineBreakOffsetArray.push({ type: 'interiorSnap', offset: toFixedFloat(firstPanelEndOffset) })
      //     }
      // }
      // }