Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Oct 18, 2023
1 parent 533991e commit 97d9167
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/manager/components/ProjectSettingsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ export default class ProjectSettingsForm extends Component<Props, State> {
this.setState(update(this.state, {model: {$merge: {defaultTimeZone}}}))
}

// TODO: shared type
// https://github.com/ibi-group/datatools-ui/pull/986#discussion_r1362271761
_onChangeTextInput = ({target}: {target: {name?: string, value: string}}) => {
const {name, value} = target
if (!name) return
Expand Down Expand Up @@ -340,11 +342,11 @@ export default class ProjectSettingsForm extends Component<Props, State> {
see: https://github.com/ibi-group/datatools-ui/pull/977#discussion_r1288916749 */}
<CustomCSVForm
name={'sharedStopsConfig'}
csvData={model.sharedStopsConfig || ''}
hideSaveButton
onChangeCsvData={(e) => this._onChangeTextInput(e)}
onSaveCsvData={() => { alert('save') }}
name={'sharedStopsConfig'}
onChangeCsvData={this._onChangeTextInput}
onSaveCsvData={() => {}}
placeholder={`stop_group_id,feed_id,stop_id,is_primary\n1,1,29240,1\n1,3,4705,0`}
/>
</FormGroup>
Expand Down
4 changes: 3 additions & 1 deletion lib/manager/components/transform/CustomCSVForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ const CustomCSVForm = (props: Props) => {
</label>
<div style={{marginBottom: '10px'}}>
<input
type='file'
name='file'
type='file'
onChange={(e) => {
// TODO: use useCallback
// https://github.com/ibi-group/datatools-ui/pull/986#discussion_r1362276889
if (e.target && e.target.files.length > 0) {
onChangeCsvData({target: {name, value: messages('uploading')}})
const reader = new FileReader()
Expand Down

0 comments on commit 97d9167

Please sign in to comment.