Skip to content

Commit 26ccf43

Browse files
committed
Adjustments to button and client settings
1 parent c2bed54 commit 26ccf43

File tree

9 files changed

+16
-17
lines changed

9 files changed

+16
-17
lines changed

client/src/components/patientData.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Button } from '@cmsgov/design-system';
22
import axios from 'axios';
33
import chart from '../images/who-charted.png'
4-
//import { SettingsType } from '../types/settings';
4+
import { SettingsType } from '../types/settings';
55
import React, { useState } from 'react';
66
import * as process from 'process';
77

@@ -11,15 +11,12 @@ export default function PatientData() {
1111
// the server component (on port 3001), does not take parameter such as pkce, version, env
1212
// they are generated by the server component.
1313
//
14-
// const [settingsState] = useState<SettingsType>({
15-
// pkce: true,
16-
// version: 'v2',
17-
// env: 'sandbox'
18-
// });
14+
const [settingsState] = useState<SettingsType>({
15+
useDefaultDataButton: true,
16+
});
1917
async function goAuthorize() {
20-
// comment out '{ params: settingsState }' since /api/authorize/authurl does not take params
2118
const test_url = process.env.TEST_APP_API_URL ? process.env.TEST_APP_API_URL : ''
22-
const authUrlResponseData = await axios.get(`${test_url}/api/authorize/authurl`/*, { params: settingsState } */)
19+
const authUrlResponseData = await axios.get(`${test_url}/api/authorize/authurl`)
2320
.then(response => {
2421
return response.data;
2522
})
@@ -32,8 +29,8 @@ export default function PatientData() {
3229
console.log(authUrlResponseData);
3330
}
3431
async function goLoadDefaults() {
35-
const authUrlResponse = await axios.get(`/api/bluebutton/loadDefaults`);
36-
window.location.href = authUrlResponse.data || '/';
32+
const loadDefaultsData = await axios.get(`/api/bluebutton/loadDefaults`);
33+
window.location.href = loadDefaultsData.data || '/';
3734
}
3835

3936
/* DEVELOPER NOTES:
@@ -57,9 +54,13 @@ export default function PatientData() {
5754
<div className='ds-u-margin-top--2'>
5855
<Button id="auth_btn" variation="solid" onClick={goAuthorize}>Authorize</Button>
5956
</div>
60-
<div className='ds-u-margin-top--2'>
61-
<Button id="load_defaults_btn" variation="solid" onClick={goLoadDefaults}>Load default data</Button>
62-
</div>
57+
{
58+
settingsState.useDefaultDataButton ?
59+
<div className='ds-u-margin-top--2'>
60+
<Button id="load_defaults_btn" variation="primary" onClick={goLoadDefaults}>Load default data</Button>
61+
</div> :
62+
null
63+
}
6364
</div>
6465
</div>
6566
);

client/src/types/settings.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
export type SettingsType = {
2-
env: 'sandbox' | 'local' | 'production',
3-
version: 'v1' | 'v2',
4-
pkce: boolean,
2+
useDefaultDataButton: boolean
53
}

server/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def load_default_data():
106106

107107

108108
def load_data_file(dataset_name, resource_file_name):
109-
response_file = open("./defaultDatasets/{}/{}.json".format(dataset_name, resource_file_name), 'r')
109+
response_file = open("./default_datasets/{}/{}.json".format(dataset_name, resource_file_name), 'r')
110110
resource = json.load(response_file)
111111
response_file.close()
112112
return resource
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)