@@ -8,13 +8,13 @@ import { ProjectDetailInterface } from "../../data/project";
8
8
import Spinner from '../Spinner' ;
9
9
10
10
const CONTROL_SEQUENCE = "Control Sequence" ;
11
- const CONTROL_SEQUENCE_WITH_INFO_TEXT = "Control Sequence with Informative Text"
11
+ const CONTROL_SEQUENCE_WITH_INFO_TEXT = "Control Sequence" ;
12
12
const DOCX = "docx" ;
13
13
14
14
const DOWNLOADABLE_FILE_LIST = [
15
15
// { label: "Full Project", ext: "zip" },
16
16
// { label: "Schematics", ext: "rvt" },
17
- { label : CONTROL_SEQUENCE , ext : DOCX } ,
17
+ // { label: CONTROL_SEQUENCE, ext: DOCX },
18
18
{ label : CONTROL_SEQUENCE_WITH_INFO_TEXT , ext : DOCX } ,
19
19
// { label: "Points List", ext: "pdf" },
20
20
// { label: "Equipment Schedules", ext: "csv" },
@@ -27,7 +27,7 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
27
27
// DOWNLOADABLE_FILE_LIST.map(({ label }) => label),
28
28
// );
29
29
30
- const [ checked , setChecked ] = useState < string [ ] > ( [ ] ) ;
30
+ const [ checked , setChecked ] = useState < string [ ] > ( [ CONTROL_SEQUENCE_WITH_INFO_TEXT ] ) ;
31
31
const [ isLoading , setLoading ] = useState < boolean > ( false ) ;
32
32
33
33
const projectConfigs : ConfigInterface [ ] = configStore . getConfigsForProject ( ) ;
@@ -78,20 +78,20 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
78
78
79
79
async function downloadFiles ( ) {
80
80
setLoading ( true ) ;
81
- if ( checked . includes ( CONTROL_SEQUENCE ) ) {
82
- const response = await fetch ( `${ process . env . REACT_APP_API } /sequence` , {
83
- method : "POST" ,
84
- headers : { "Content-Type" : "application/json" } ,
85
- body : JSON . stringify ( { ...getSequenceData ( ) , DEL_INFO_BOX : [ true ] } ) ,
86
- } ) ;
87
-
88
- // TODO: Handle error responses which do not contain an actual file
89
- const sequenceDocument = await response . blob ( ) ;
90
- const placeholderLink = document . createElement ( "a" ) ;
91
- placeholderLink . href = window . URL . createObjectURL ( sequenceDocument ) ;
92
- placeholderLink . download = `${ CONTROL_SEQUENCE } .${ DOCX } ` ;
93
- placeholderLink . click ( ) ;
94
- }
81
+ // if (checked.includes(CONTROL_SEQUENCE)) {
82
+ // const response = await fetch(`${process.env.REACT_APP_API}/sequence`, {
83
+ // method: "POST",
84
+ // headers: { "Content-Type": "application/json" },
85
+ // body: JSON.stringify({...getSequenceData(), DEL_INFO_BOX: [true]}),
86
+ // });
87
+
88
+ // // TODO: Handle error responses which do not contain an actual file
89
+ // const sequenceDocument = await response.blob();
90
+ // const placeholderLink = document.createElement("a");
91
+ // placeholderLink.href = window.URL.createObjectURL(sequenceDocument);
92
+ // placeholderLink.download = `${CONTROL_SEQUENCE}.${DOCX}`;
93
+ // placeholderLink.click();
94
+ // }
95
95
96
96
if ( checked . includes ( CONTROL_SEQUENCE_WITH_INFO_TEXT ) ) {
97
97
const response = await fetch ( `${ process . env . REACT_APP_API } /sequence` , {
@@ -118,18 +118,18 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
118
118
119
119
< Spinner
120
120
loading = { isLoading }
121
- text = "Creating Sequence Document. Please wait... this may take up to one minute ."
121
+ text = "Creating Sequence Document. Please wait... this may take a few minutes ."
122
122
/>
123
123
124
124
< ul className = "check-list" >
125
125
{ DOWNLOADABLE_FILE_LIST . map ( ( { label, ext } ) => (
126
126
< li key = { label } className = "template" >
127
- < label >
128
- < input
127
+ < label className = "no-pointer" >
128
+ { /* <input
129
129
type="checkbox"
130
130
onChange={(ev) => updateItem(ev, label)}
131
131
checked={checked.includes(label)}
132
- />
132
+ />*/ }
133
133
{ label }
134
134
< span className = "info uppercase" > .{ ext } </ span >
135
135
</ label >
0 commit comments