diff --git a/src/components/BuildingOverview/folderStructure.js b/src/components/BuildingOverview/folderStructure.js new file mode 100644 index 0000000000000000000000000000000000000000..8add0f48724cf684517daddc379df294490f3428 --- /dev/null +++ b/src/components/BuildingOverview/folderStructure.js @@ -0,0 +1,30 @@ +const defaultStructure = { + Utility_Bills: null, + Site_Visit_Media: null, + Reports: null, + Notes: null, + 'Building-Level_Financial_Documents': null, + 'Building-Level_Engineering_Analysis': null, + Sensors: null, + Projects: { + '"Projects"_Template': { + Financial_Analysis: null, + Engineering_Analysis: null, + Notes: null, + Reports: null, + Contracts_and_Legal_Documents: null, + Proposals_and_Price_Quotes: null, + Construction_Management_Documents: { + Permits: null, + Contractor_Agreements: null, + Contractor_Insurance_Documents: null, + Contractor_Quotes: { + 'Reference_Quotes_(We_Did_Not_Use)': null, + 'Active_Quotes_(We_Used)': null, + }, + }, + }, + }, +}; + +export default defaultStructure; diff --git a/src/components/BuildingOverview/index.js b/src/components/BuildingOverview/index.js index 45014d37808c858d7a16472fe2dbd989726c1a9a..e95df713438a207b4e486e09bc70c7bd31752a38 100644 --- a/src/components/BuildingOverview/index.js +++ b/src/components/BuildingOverview/index.js @@ -3,6 +3,7 @@ import documentsPropType from '../../containers/Documents/propTypes'; import DocumentCardViewer from '../../components/DocumentCardViewer'; import LinkBarDetail from '../../components/LinkBarDetail'; import ProjectCard from '../ProjectCard'; +import folderStructure from './folderStructure'; import { completeProjectPropTypes, completeOverviewPropTypes, @@ -22,7 +23,7 @@ export default class BuildingOverview extends Component { } componentDidMount() { - this.props.getFolderUrl(this.state.documentPath); + this.props.getFolderUrl(this.state.documentPath, folderStructure); } renderProjects = () => { @@ -42,6 +43,7 @@ export default class BuildingOverview extends Component { } render() { + const loadingFolder = this.props.documents.folderUrl === '#' || !this.props.documents.folderUrl; return (
{ @@ -111,5 +110,4 @@ DocumentCardViewer.propTypes = { documents: documentsPropType.isRequired, getDocuments: PropTypes.func.isRequired, uploadDocument: PropTypes.func.isRequired, - getFolderUrl: PropTypes.func.isRequired, }; diff --git a/src/containers/Documents/actions.js b/src/containers/Documents/actions.js index 52a86b1c4736720cc8aad08709ef4f684bfb5440..062d68dce188216c33ec41e06f33ba8d9e6991e6 100644 --- a/src/containers/Documents/actions.js +++ b/src/containers/Documents/actions.js @@ -80,10 +80,11 @@ export function documentUploadError(error) { }; } -export function loadFolderUrl(folderPath) { +export function loadFolderUrl(folderPath, folderStructure = {}) { return { type: LOAD_FOLDER_URL, folderPath, + folderStructure, }; } diff --git a/src/containers/Documents/sagas.js b/src/containers/Documents/sagas.js index 468af8eed6e4a8e6674001ac3da8765314d798f5..7150f54705f06676e60c85155273e5b0b19488f9 100644 --- a/src/containers/Documents/sagas.js +++ b/src/containers/Documents/sagas.js @@ -155,11 +155,12 @@ function* deleteDocument(action) { } function* getFolderUrl(action) { - const { folderPath } = action; + const { folderPath, folderStructure } = action; + const structure = JSON.stringify(folderStructure); const res = yield call( request, - `${documentURL}?path=${folderPath}&folder=true`, { + `${documentURL}?path=${folderPath}&structure=${structure}&folder=true`, { method: 'GET', headers: getHeaders(), }