Skip to content

Commit 2a7d153

Browse files
committed
update source documents and remove option to download without info text
1 parent 637eb6d commit 2a7d153

File tree

9 files changed

+528
-764
lines changed

9 files changed

+528
-764
lines changed

client/src/components/modal/DownloadModal.tsx

+21-21
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { ProjectDetailInterface } from "../../data/project";
88
import Spinner from '../Spinner';
99

1010
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";
1212
const DOCX = "docx";
1313

1414
const DOWNLOADABLE_FILE_LIST = [
1515
// { label: "Full Project", ext: "zip" },
1616
// { label: "Schematics", ext: "rvt" },
17-
{ label: CONTROL_SEQUENCE, ext: DOCX },
17+
// { label: CONTROL_SEQUENCE, ext: DOCX },
1818
{ label: CONTROL_SEQUENCE_WITH_INFO_TEXT, ext: DOCX },
1919
// { label: "Points List", ext: "pdf" },
2020
// { label: "Equipment Schedules", ext: "csv" },
@@ -27,7 +27,7 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
2727
// DOWNLOADABLE_FILE_LIST.map(({ label }) => label),
2828
// );
2929

30-
const [checked, setChecked] = useState<string[]>([]);
30+
const [checked, setChecked] = useState<string[]>([CONTROL_SEQUENCE_WITH_INFO_TEXT]);
3131
const [isLoading, setLoading] = useState<boolean>(false);
3232

3333
const projectConfigs: ConfigInterface[] = configStore.getConfigsForProject();
@@ -78,20 +78,20 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
7878

7979
async function downloadFiles() {
8080
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+
// }
9595

9696
if (checked.includes(CONTROL_SEQUENCE_WITH_INFO_TEXT)) {
9797
const response = await fetch(`${process.env.REACT_APP_API}/sequence`, {
@@ -118,18 +118,18 @@ function DownloadModal({ isOpen, close }: ModalInterface) {
118118

119119
<Spinner
120120
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."
122122
/>
123123

124124
<ul className="check-list">
125125
{DOWNLOADABLE_FILE_LIST.map(({ label, ext }) => (
126126
<li key={label} className="template">
127-
<label>
128-
<input
127+
<label className="no-pointer">
128+
{/*<input
129129
type="checkbox"
130130
onChange={(ev) => updateItem(ev, label)}
131131
checked={checked.includes(label)}
132-
/>
132+
/>*/}
133133
{label}
134134
<span className="info uppercase">.{ext}</span>
135135
</label>

client/src/components/steps/Landing.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function Landing() {
4242
Writing a detailed and accurate control sequence is hard to do!
4343
This tool makes it easy to design high performance control sequences following ASHRAE Guideline 36 and best practices.
4444
After inputting project details, the tool will produce a detailed sequence of operations document.
45-
You will have the option to download this document with or without the instructional text.
4645
</p>
4746

4847
{/*<ul>

0 commit comments

Comments
 (0)