Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
482e3aad
Commit
482e3aad
authored
May 05, 2018
by
Zac Wood
Browse files
Web saves schedule as a file on generate
parent
35483d61
Changes
3
Hide whitespace changes
Inline
Side-by-side
schedules_web/package.json
View file @
482e3aad
...
...
@@ -10,6 +10,7 @@
"license"
:
"Apache"
,
"private"
:
true
,
"devDependencies"
:
{
"@types/file-saver"
:
"^1.3.0"
,
"@types/node"
:
"^9.6.6"
,
"awesome-typescript-loader"
:
"^5.0.0"
,
"source-map-loader"
:
"^0.2.3"
,
...
...
schedules_web/src/components/App.tsx
View file @
482e3aad
...
...
@@ -2,6 +2,7 @@ import * as React from 'react';
import
Section
from
'
../section
'
;
import
SectionList
from
'
./SectionList
'
;
import
Search
from
'
./Search
'
;
import
*
as
FileSaver
from
'
file-saver
'
;
interface
State
{
currentSchedule
:
Section
[];
...
...
@@ -33,7 +34,10 @@ class App extends React.Component<any, State> {
},
})
.
then
(
response
=>
response
.
text
())
.
then
(
text
=>
console
.
log
(
text
));
.
then
(
text
=>
{
const
blob
=
new
Blob
([
text
],
{
type
:
'
text/plain;charset=utf-9
'
});
FileSaver
.
saveAs
(
blob
,
'
GMU Fall 2018.ics
'
);
});
}
render
()
{
...
...
schedules_web/yarn.lock
View file @
482e3aad
...
...
@@ -6,6 +6,10 @@
version "0.7.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
"@types/file-saver@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@types/file-saver/-/file-saver-1.3.0.tgz#0ef213077e704fc3f4e7a86cfd31c9de4f4f47a7"
"@types/node@*", "@types/node@^9.6.6":
version "9.6.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.6.tgz#439b91f9caf3983cad2eef1e11f6bedcbf9431d2"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment