\r\n
\r\n {fileNameToReProcess.map((fileData) => (\r\n
\r\n \r\n
\r\n ))}\r\n
\r\n );\r\n }\r\n}\r\nPPointCloudFileUploadDialog.propTypes = {\r\n project: propTypes.object,\r\n appState: propTypes.object,\r\n notify: propTypes.func,\r\n};\r\n\r\nconst PointCloudFileUploadDialog = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n null,\r\n { forwardRef: true }\r\n)(PPointCloudFileUploadDialog);\r\nexport default PointCloudFileUploadDialog;\r\n","/* eslint-disable no-undefined */\r\nimport * as Actions from \"../redux/actions/index\";\r\n\r\nimport { ContextMenu, ContextMenuTrigger } from \"react-contextmenu\";\r\nimport { Environment, constants } from \"../config\";\r\nimport React, { Component, Fragment } from \"react\";\r\nimport { Typography, withStyles } from \"@material-ui/core\";\r\n\r\nimport AddIcon from \"@material-ui/icons/AddCircle\";\r\nimport Checkbox from \"@material-ui/core/Checkbox\";\r\nimport DeleteIcon from \"@material-ui/icons/Delete\";\r\nimport CloudDownload from \"@material-ui/icons/CloudDownload\";\r\nimport EnhancedTable from \"../widgets/DataTableNew\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport Info from \"@material-ui/icons/Info\";\r\nimport InformativeDialog from \"../commonDialogs/InformativeDialog\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport PointCloudFileUploadDialog from \"./PointCloudFileUploadDialog\";\r\nimport Privileged from \"../widgets/Privileged\";\r\nimport ThreeD from \"@material-ui/icons/ThreeDRotation\";\r\nimport Tooltip from \"@material-ui/core/Tooltip\";\r\nimport Utils from \"../core/Utils\";\r\nimport WarningDialog from \"../commonDialogs/WarningDialog\";\r\nimport { connect } from \"react-redux\";\r\nimport propTypes from \"prop-types\";\r\nimport { withRouter } from \"react-router-dom\";\r\n\r\nconst styles = (theme) => ({\r\n root: {\r\n flexGrow: 1,\r\n },\r\n linkDecoration: {\r\n cursor: \"pointer\",\r\n color: \"#0000ff\",\r\n },\r\n margin: {\r\n marginTop: theme.spacing(0),\r\n marginBottom: theme.spacing(2),\r\n marginLeft: theme.spacing(2),\r\n marginRight: theme.spacing(2),\r\n },\r\n l_m: {\r\n marginLeft: theme.spacing(2),\r\n },\r\n});\r\n\r\nconst mapStateToProps = (state) => {\r\n return {\r\n project: state.projects.currentProject,\r\n projects: state.projects.projectList,\r\n appState: state.common.appState,\r\n userProfileData: state.common.userProfileData,\r\n };\r\n};\r\n\r\nlet downloadList = new Map();\r\n\r\nfunction mapDispatchToProps(dispatch) {\r\n return {\r\n updateProject: (projectData) =>\r\n dispatch(Actions.updateProject(projectData)),\r\n notify: (data) => dispatch(Actions.notify(data)),\r\n setSelectedPointCloudModels: (pointCloudModels) =>\r\n dispatch(Actions.setSelectedPointCloudModels(pointCloudModels)),\r\n };\r\n}\r\n\r\nclass PPointCloudFileListView extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n selectedPointCloudFiles: {},\r\n isTranslationProgressCheckInProgress: false,\r\n allFileSelect: false,\r\n fileDetails: null,\r\n userRoleData: undefined,\r\n userRoleAdmin: false,\r\n userRoleViewer: false,\r\n isSharedProject: false,\r\n };\r\n this.dialogRef = React.createRef();\r\n this.dialogUploadRef = React.createRef();\r\n this.warningDialogRef = React.createRef();\r\n this.fileDetailsDialogRef = React.createRef();\r\n this.translationInProgressDialogRef = React.createRef();\r\n }\r\n\r\n componentDidMount() {\r\n const { pointCloudFileListViewRef } = this.props;\r\n const { project } = this.props;\r\n pointCloudFileListViewRef(this);\r\n if (project && project.Data) {\r\n if (!this.state.userRoleAdmin && !this.state.userRoleViewer) {\r\n this.getRoleDataFromHeader();\r\n this.getTypeOfProject();\r\n }\r\n }\r\n }\r\n async componentDidUpdate() {\r\n const { project } = this.props;\r\n if (project && project.Data) {\r\n if (!this.state.userRoleAdmin && !this.state.userRoleViewer) {\r\n this.getRoleDataFromHeader();\r\n }\r\n if (!this.state.isSharedProject) {\r\n this.getTypeOfProject();\r\n }\r\n }\r\n }\r\n getTypeOfProject() {\r\n const { project } = this.props;\r\n if (project.orgId != this.props.appState.Auth._idData[\"custom:OrgId\"]) {\r\n this.setState({ isSharedProject: true });\r\n }\r\n }\r\n getUserInfo(params) {\r\n const { appState, project } = this.props;\r\n appState.AWSDBService.queryAllItems(params)\r\n .then((data) => {\r\n this.setState({ userRoleData: data });\r\n // for (let i = 0; i < this.state.userRoleData.Items.length; i++) {\r\n // if (\r\n // this.state.userRoleData.Items[i].email ===\r\n // this.props.userProfileData.email &&\r\n // this.state.userRoleData.Items[i].role === \"Admins\"\r\n // ) {\r\n // this.setState({ userRoleAdmin: true });\r\n // break;\r\n // }\r\n // }\r\n if (project.Data.ProjectOwner === this.props.userProfileData.email) {\r\n this.setState({ userRoleAdmin: true });\r\n } else {\r\n this.setState({ userRoleViewer: true });\r\n }\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n }\r\n toCheckRoleofUser() {\r\n const { appState } = this.props;\r\n var params = {\r\n Key: { Project_Id: this.props.project.Project_Id },\r\n TableName: constants[Environment].projectsTableName,\r\n };\r\n let projectName = this.props.appState.AWSDBService.getItem(params).then(\r\n (data) => {\r\n var orgID = data.orgId;\r\n var params = {\r\n TableName: constants[Environment].existingSharedUserDataTable,\r\n ScanIndexForward: false,\r\n IndexName: \"orgId-Creation_Date-index\",\r\n KeyConditionExpression: \"owner_orgid = :dummyValue\",\r\n ExpressionAttributeValues: {\r\n \":dummyValue\": orgID,\r\n },\r\n };\r\n const listOfExistingOrgUsers = this.getUserInfo(params);\r\n }\r\n );\r\n }\r\n getRoleDataFromHeader() {\r\n for (let index = 0; index < this.props.projects.length; index++) {\r\n const PID = this.props.projects[index].Project_Id;\r\n if (this.props.project.Project_Id == PID) {\r\n var role = this.props.projects[index].Role;\r\n if (role === \"Admins\") {\r\n this.setState({ userRoleAdmin: true });\r\n } else if (role === \"Viewers\") {\r\n this.setState({ userRoleViewer: true });\r\n } else if (role === undefined) {\r\n var params = {\r\n Key: { Project_Id: this.props.project.Project_Id },\r\n TableName: constants[Environment].projectsTableName,\r\n };\r\n let projectName = this.props.appState.AWSDBService.getItem(\r\n params\r\n ).then((data) => {\r\n var orgID = data.orgId;\r\n var params = {\r\n TableName: constants[Environment].existingSharedUserDataTable,\r\n ScanIndexForward: false,\r\n IndexName: \"orgId-Creation_Date-index\",\r\n KeyConditionExpression: \"owner_orgid = :dummyValue\",\r\n ExpressionAttributeValues: {\r\n \":dummyValue\": orgID,\r\n },\r\n };\r\n this.getUserInfo(params);\r\n });\r\n }\r\n }\r\n }\r\n }\r\n // componentWillUnmount() {\r\n // const { pointCloudFileListViewRef } = this.props;\r\n // pointCloudFileListViewRef(undefined);\r\n // }\r\n toCheckRoleofUser() {\r\n for (let index = 0; index < this.props.projects.length; index++) {\r\n if (\r\n this.props.project.Project_Id === this.props.projects[index].Project_Id\r\n ) {\r\n var role = this.props.projects[index].Role;\r\n if (role === \"Admins\") {\r\n this.setState({ userRoleAdmin: true });\r\n } else {\r\n this.setState({ userRoleViewer: true });\r\n }\r\n }\r\n }\r\n }\r\n get _fileColumnName() {\r\n if (this.state.allFileSelect) {\r\n return `Point Cloud Model (All) selected`;\r\n } else if (Object.keys(this.state.selectedPointCloudFiles).length > 0) {\r\n return `Point Cloud Model (${\r\n Object.keys(this.state.selectedPointCloudFiles).length\r\n }) selected`;\r\n } else {\r\n return `Point Cloud Model`;\r\n }\r\n }\r\n\r\n get dataColumns() {\r\n const { classes } = this.props;\r\n let dataColumns = [];\r\n dataColumns.push({\r\n id: \"action\",\r\n numeric: false,\r\n disablePadding: true,\r\n label: (\r\n