Skip to content

Commit 8b3e8af

Browse files
committed
set default iari source to researcher6
1 parent 391b1e8 commit 8b3e8af

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "iare",
3-
"version": "0.3.1.32",
4-
"version_name": "0.3.1.32 Include iari source researcher6 ",
3+
"version": "0.3.1.33",
4+
"version_name": "0.3.1.33 set default iari source to researcher6",
55
"private": true,
66
"type": "module",
77
"dependencies": {

src/constants/iariSources.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ export const IariSources = {
3131
caption: 'IARI Local',
3232
proxy: 'http://localhost:5001/v2',
3333
},
34-
iari_r6_stage: { // iari_researcher6
35-
key: 'iari_r6_stage',
34+
35+
iari_stage_r6: { // iari_researcher6
36+
key: 'iari_stage_r6',
3637
caption: 'IARI researcher6 Stage',
3738
proxy: 'http://researcher6.fnf.archive.org:5088/v2/',
3839
},

src/index.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ const getIariSource = (qParams, targetEnvironment) => {
3131

3232
// hard-set to iari_prod for production
3333
if (targetEnvironment === 'env-production') return IariSources.iari_prod.key
34-
// else default to stage if not specified
34+
35+
const defaultIariSourceKey = IariSources.iari_stage_r6.key
36+
37+
// fall back to default if not specified as url parameter
3538
const sourceKey = queryParameters.has("iari-source")
3639
? queryParameters.get("iari-source")
3740
: (targetEnvironment === 'env-local')
3841
? IariSources.iari_local.key // default when local
39-
: IariSources.iari_stage.key // default otherwise
42+
: defaultIariSourceKey
4043

41-
// if specified source not in our defined choices, default to stage, and error
44+
// if specified source not in our defined choices, set to default, and log error
4245
// TODO we should change this so we get a UI run time error
4346
if (!IariSources[sourceKey]) {
4447
console.error(`IARI Source ${sourceKey} not supported.`)
45-
return IariSources.iari_stage.key
48+
return defaultIariSourceKey
4649
}
50+
4751
return sourceKey
4852
}
4953

0 commit comments

Comments
 (0)