Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
object store: make endpoint input work
Browse files Browse the repository at this point in the history
Make the endpoint input component work correctly by letting it propagate
the user input to the parent component

Signed-off-by: Moritz Röhrich <[email protected]>
  • Loading branch information
m-ildefons authored and votdev committed Nov 3, 2023
1 parent 5b80677 commit f5230a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
24 changes: 17 additions & 7 deletions src/components/EndpointInput/EndpointInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,30 @@ class EndpointInput extends React.Component {
}

render() {
const { getFieldDecorator, getFieldsValue, setFieldsValue } = this.props
const { tlsSecrets } = this.props

function secretSelect(value) {
setFieldsValue({
...getFieldsValue(),
tlsSecret: value,
})
}

return (
<div style={{ display: 'flex' }}>
<FormItem label="Domain Name" style={{ flex: 0.6 }} labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
<Input placeholder={this.state.domainName} />
{getFieldDecorator('domainName', {})(<Input placeholder={this.state.domainName} />)}
</FormItem>

<FormItem label="TLS Secret" style={{ flex: 0.6 }} labelCol={{ span: 8 }} wrapperCol={{ span: 14 }}>
<Select>
{tlsSecrets.map((opt) => {
return (<Option key={opt.name}>{opt.name}</Option>)
})}
</Select>
<FormItem label="TLS Secret" style={{ flex: 0.6 }} labelCol={{ span: 8 }} apperCol={{ span: 14 }}>
{getFieldDecorator('tlsSecret', {})(
<Select onChange={secretSelect}>
{tlsSecrets.map((opt) => {
return (<Option key={opt.name}>{opt.name}</Option>)
})}
</Select>
)}
</FormItem>
</div>
)
Expand Down
1 change: 0 additions & 1 deletion src/models/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default {
effects: {
*query({ payload }, { call, put }) {
const data = yield call(listSecrets, payload)
console.log(data)
yield put({ type: 'listSecrets', payload: { ...data } })
},
*startWS({ payload }, { select }) {
Expand Down
6 changes: 6 additions & 0 deletions src/routes/objectStorage/CreateObjectStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const modal = ({
...getFieldsValue(),
size: `${getFieldsValue().size}${getFieldsValue().unit}`,
staleReplicaTimeout: 2880,
endpoints: [
{
domainName: `${getFieldsValue().domainName}`,
secretName: `${getFieldsValue().tlsSecret}`,
},
],
}

if (data.unit) { delete data.unit }
Expand Down

0 comments on commit f5230a0

Please sign in to comment.