-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #319 from lookit/develop
Deploy development changes to production.
- Loading branch information
Showing
9 changed files
with
53 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
lts/dubnium | ||
lts/erbium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
dist: trusty | ||
language: node_js | ||
node_js: | ||
- 10 | ||
- 12 | ||
|
||
sudo: false | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const addSearchParams = function(exitUrl, responseId, hashChildId){ | ||
try { | ||
// Parse URL and search params | ||
const url = new URL(exitUrl); | ||
const params = new URLSearchParams(url.search); | ||
|
||
// Set child and response values | ||
// params.set('child', this.get('session.hash_child_id')); | ||
// params.set('response', this.get('session.id')) | ||
params.set('child', hashChildId); | ||
params.set('response', responseId); | ||
|
||
// Set these changes to the URL | ||
url.search = params; | ||
|
||
// Return updated URL | ||
return url.toString(); | ||
|
||
} catch (TypeError) { | ||
// If the provided URL can't be parsed, return root. | ||
return '/' | ||
} | ||
}; | ||
|
||
export { addSearchParams }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { module, test} from 'qunit'; | ||
import { addSearchParams } from '../../../utils/add-search-params'; | ||
|
||
module('Unit | Utility | add search params'); | ||
|
||
test('Test add search params function', function(assert) { | ||
assert.expect(3); | ||
assert.equal(addSearchParams('https://lookit.mit.edu', 'repsonse-id', 'hash-child-id'), 'https://lookit.mit.edu/?child=hash-child-id&response=repsonse-id'); | ||
assert.equal(addSearchParams('not-a-url', 'repsonse-id', 'hash-child-id'), '/'); | ||
assert.equal(addSearchParams(undefined, 'repsonse-id', 'hash-child-id'), '/'); | ||
}); | ||
|