Commit graph

95 commits

Author SHA1 Message Date
Matthew Taylor
758371dadd
Merge pull request #1671 from mewtaylor/issue/node-upgrade
Upgrade compatibility to node 8
2017-12-11 15:52:35 -05:00
Colby Gutierrez-Kraybill
cd27b68cd1
Merge pull request #1720 from LLK/hotfix/cache-nav-session-endpoints
[Develop] Hotfix/cache nav session endpoints
2017-12-01 16:01:19 -05:00
Ray Schamp
51d980cfb3 Conditionally purge on deploys
We can configure this within Travis
2017-12-01 15:34:31 -05:00
Colby Gutierrez-Kraybill
0ba2693c0e Cache logged out account-nav.json and session
Cache ^/fragment/account-nav.json and ^/session for logged out users
2017-12-01 13:50:43 -05:00
Colby Gutierrez-Kraybill
c65b0ef907 Stomp set-cookie
set-cookie causes the cache to not cache the page. Since we’re not trying to track the user beyond, we don’t want to try resetting the cookie again with the same info
2017-12-01 11:22:24 -05:00
Colby Gutierrez-Kraybill
1083a7a79f Fix typos and correct cookie
scratchsessionsid not scratchsessionid
Cookie needs key added for assigned value of scratchlanguage
2017-12-01 10:18:47 -05:00
Colby Gutierrez-Kraybill
91b3feb0b1 Merge pull request #1708 from colbygk/session-caching
[Master] Project page caching
2017-12-01 09:59:26 -05:00
Colby Gutierrez-Kraybill
69757e6bec
Revert "[Master] Project page caching" 2017-12-01 09:24:17 -05:00
Colby Gutierrez-Kraybill
0c109113c7 Failed on actual run, needs to load languages from directory below 2017-11-30 15:01:08 -05:00
Colby Gutierrez-Kraybill
1e8bf2653c Correct brace addition to VCL 2017-11-30 11:38:14 -05:00
Colby Gutierrez-Kraybill
785667691e Fix up lint errors 2017-11-30 11:30:45 -05:00
Colby Gutierrez-Kraybill
66edcb60a8 Remove unused vcl code generators, setBackend and setFrontend 2017-11-30 11:28:53 -05:00
Colby Gutierrez-Kraybill
279e25eb69 Simplify how the conditional is created for setting the S3 backend, caching related behavior for non-logged in users and maintaining language settings and passing to backend 2017-11-30 11:11:38 -05:00
Colby Gutierrez-Kraybill
7a6be0306b Cache ^/projects/ to users who are not logged-in 2017-11-30 11:11:38 -05:00
Colby Gutierrez-Kraybill
9efd8e65eb Add specific /projects cache handling when user is not logged-in 2017-11-30 11:11:26 -05:00
Matthew Taylor
2dd82e858e use writeFileSync
Thanks @thisandagain!
2017-11-16 09:58:08 -05:00
Matthew Taylor
b584bb80e7 Upgrade compatibility to node 8
This fixes an issue in compilation by upgrading node-sass to v4.6, and also upgrades express in the process.

Callback added to `writeFile` in `get-localized-urls` in order to avoid a deprecation warning during `make translations`.
2017-11-15 13:28:10 -05:00
chrisgarrity
13284dee21 Rename AnimateYourNameGuide to NameGuide
remove obsolete static URL so localizations get picked up correctly.

git-ignore localized-urls.json as it’s pulled from scratch-resources now.
2017-09-26 16:56:34 -04:00
chrisgarrity
1d08a9e201 Rename AnimateYourNameGuide to NameGuide
remove obsolete static URL so localizations get picked up correctly.

git-ignore localized-urls.json as it’s pulled from scratch-resources now.
2017-09-25 17:16:58 -04:00
chrisgarrity
376aee0eb3 Add error checking and testing for translations (#1401)
* Add error checking and testing for translations. Also make build-locales quieter if there are no problems.

* Allow build with broken translations (to allow development), but fail test so that broken translations don't get merged or deployed
2017-08-15 09:32:18 -04:00
chrisgarrity
39b1400705 Handle /help redirect (#1363) 2017-06-23 10:28:34 -04:00
chrisgarrity
74e315dc71 Add new Tips page (#1357)
New of tips page, uses cards from new resources server (s3)

* added get-localized-urls script to get the generated json from the s3 bucket
* added /tips route
* correct localized-urls for other pages
* remove thingstotry
* redirect /go
* fix up /info/cards view to use resources (s3).
* redirect /go to /tips
* change /hoc redirect from /go to /tips
* Add full set of cards pdf download to tips localization
* removed cards and guides from static PDFs, they are all coming from resources.scratch.mit.edu now.
* removed things to try view

Corrections for reviews:
* decided to pretty print the localized URLs
* replaced console.errors with process.stdout and fail with exit(1)
* formatted localized-urls to make it easier to read
* moved link outside  `<Button…` makes whole button clickable instead of just text
* fixed up css styles, removed unnecessary classes
* corrected “unused” resource links
2017-06-21 16:20:18 -04:00
Matthew Taylor
a8cf1af73c Merge pull request #1316 from mewtaylor/issue/explore-projects
Fix r2-3978: Use regex in express patterns to limit scope
2017-05-24 12:49:09 -04:00
Matthew Taylor
79e778af7a make comment explanatory of new style
Thanks @rschamp!
2017-05-24 08:51:28 -04:00
Matthew Taylor
bab863cd14 Apply defaults for untranslated pages too
since we’ll need them for nav/footer strings
2017-05-23 13:16:46 -04:00
Matthew Taylor
87da9f3d8a Use regex in express patterns to limit scope
This fixes https://github.com/LLK/scratchr2/issues/3798 by using regex in expressjs patterns, and then also parsing those regex patterns for fastly, such that we can limit the scope of the regex created for a specific view
2017-05-18 13:57:49 -04:00
Matthew Taylor
3a27b1d2e2 Apply english strings as default translations
This fixes #1303 by ensuring that, if a language does not have a string, the default will be applied.
2017-05-03 14:21:27 -04:00
Matthew Taylor
ff0c5eaa05 remove unused variable 2017-04-26 08:40:58 -04:00
Matthew Taylor
905fe8ac10 Remove setBucketNameHeader
Missed this one – it’s now covered in the custom vcl
2017-04-26 08:35:15 -04:00
Matthew Taylor
d563535ba5 Move string set methods out of fastly-extended
This also moves all helper methods in `configure-fastly` into a separate utility file, and adds some additional unit tests for those utilities now that they are separated.
2017-04-25 13:18:13 -04:00
Matthew Taylor
ca067fdc5e Use custom VCL for Pass/!Pass conditions
We’ve now exceeded our max number of characters for a condition in the Fastly API, and we need to make it larger to accommodate regex conditionals that can match on any of the routes in www currently.

This fixes the issue by moving the conditions – and the states that are affected by it, like setting the backend or cache ttls – to two custom vcl files that are updated via the Fastly API. One is for the `vcl_rev` config, and one is for the `vcl_fetch` config.
2017-04-25 11:06:57 -04:00
Sarah Otts
1789720ba4 Add card translations (#1275)
* Added pdfs; added translations for /cards

* Added spanish cards to ttt page

* Added catalan cards to ttt and /cards

* Added zh-tw cards to /cards and /go and fixed /cards link for Fashion cards for all languages

* Removed duplicate starter link for ca, remove starter links for zh-tw (no translation)

fixes #1276 (swedish)
2017-04-19 16:40:57 -04:00
Matthew Taylor
1b4c14b333 Exit on error in translation building
thanks @chrisgarrity !
2017-03-13 11:51:31 -04:00
Matthew Taylor
5ca880d16a still iterate over languages for views without l10n
Fixes #1199 by continuing the iteration over languages even if a view doesn’t have an l10n file. The issue was that only the `en` language object was getting added when the view didn’t have an l10n file, because of the `hasOwnProperty` check. This adjusts it to iterate over languages anyways, and only ouput the `No translations for…` message if it’s for a language of a view that does have an l10n file.
2017-03-13 10:00:30 -04:00
Matthew Taylor
0912fca5f2 Use scratchr2_translations for language files
Adjusts the translation system to go back to using a github repo to store snapshots of transltions, but continues to use new `.json` formatted files
2017-02-24 07:58:50 -05:00
chrisgarrity
82785435bf New scripts to generate translations from Transifex
Added tx-import, expects TX_TOKEN environment variable to be set to an API token for Transifex. If no API token exists it’ll just use the default English strings for everything.

Removed the localization spot checks because they were checking tha json got built from po files. With Tx-import the files are already json, and may possibly be missing.
2017-02-15 22:51:15 -05:00
chrisgarrity
9e4ef5fb1b Tx import (#1143)
* Transifex transition

Scripts and configuration for transition to Transifex for translation.

* Transifex transition update

changed the name of the place where translations are saved from ‘translations’ to localizations so that we can have a consistent name in both scratchr2, and scratch-www.

A couple of other little clean-ups to make sure that it’s ES5 compliant.
- don’t use const
- don’t use template strings (backticks)
2017-01-18 12:57:14 -05:00
Matthew Taylor
8e964cdfdd Still build url localization for languages with none
otherwise, they will get the id for the url, rather than the english version. Fixes #1059
2016-11-21 15:36:50 -05:00
Matthew Taylor
e01afa0161 Add new cards and card thumbs to www
Fixes #856. This also updates the styling of the `cards.jsx` view to follow the trello style guide, as previously discussed.
2016-10-19 13:45:37 -04:00
chrisgarrity
5b2ff1a4ca Update md5map fixtures for tests
Also cleaned up comments from @mewtaylor
2016-10-11 19:28:13 -04:00
chrisgarrity
1339683a73 Fix #940
Most problems were due to strings being duplicated and overwriting each other. Updated the build-locales script to keep track of duplicates.
Project Curated by on the splash page was just missing the formatMessage call.
2016-10-11 12:33:31 -04:00
Ray Schamp
7ae7db76a2 Fix typo 2016-07-22 12:45:18 -04:00
Ray Schamp
62609cbc87 Collapse by beginning all routes with a common ^ 2016-07-22 12:38:24 -04:00
Ray Schamp
e5ad1872d0 Don't require end slashes when replacing arguments 2016-07-22 11:47:26 -04:00
Matthew Taylor
6e67e3973c Revert "Attempt 2 – reprioritize header conditionals"
This reverts commit 1ee9358be4.
2016-07-08 10:31:17 -04:00
Matthew Taylor
1ee9358be4 Attempt 2 – reprioritize header conditionals 2016-07-08 10:18:02 -04:00
Matthew Taylor
ce9b3561f2 use custom-defined internal separator
There is some stacking that happens in object keys that had been using the `-` to track language/view hierarchies, which was thrown off by view names that used a `-` in them. Switch to using `:`, and also make it customizable. Fixes #655
2016-07-01 14:27:41 -04:00
Matthew Taylor
dfc4f9574d use route aliases for generalizable route patterns
1. match all `^/explore` to www
2. match all `^/search` to www
3. match all `^/conference` to www
2016-06-14 11:28:20 -04:00
Ray Schamp
e323cbbb9f Terminate view.html rewrite rule
Otherwise anything with html in the path matches. Fixes #527
2016-05-31 09:38:13 -04:00
Ray Schamp
19758f3901 Merge pull request #521 from rschamp/bugfix/cache-condition
[Release] Fix cache condition request
2016-05-27 14:10:33 -04:00