Skip to content

Commit

Permalink
Merge pull request #62 from rekcurd/hotfix/request-only-when-model-sw…
Browse files Browse the repository at this point in the history
…itched

Thank you @yuki-mt !
Merged
  • Loading branch information
keigohtr authored Jan 22, 2019
2 parents 57dc2ba + 4098b16 commit 5893f85
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/src/components/App/Deploy/DeployStatusForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ interface StateProps {
switchModelsStatus: APIRequest<boolean[]>
initialValues: {
status
switch
delete
}
}
Expand All @@ -205,6 +206,7 @@ const mapStateToProps = (state: any, extraProps: DeployStatusFormCustomProps) =>
...state.form,
initialValues: {
status: extraProps.deployStatus,
switch: extraProps.deployStatus,
delete: {
services: initialDeleteStatus
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/App/Deploy/DeployStatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class DeployStatusTable extends React.Component<DeployStatusProps, {tooltipOpen}
return (
<Field
component={CustomRadioButton}
name={`status.${serviceId}`}
name={`switch.${serviceId}`}
serviceId={serviceId}
modelId={model.id}
/>
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/components/App/Deploy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,14 @@ class Deploy extends React.Component<DeployStatusProps, DeployStatusState> {
const { applicationId } = this.props.match.params

const apiParams: SwitchModelParam[] =
Object.entries(params.status)
Object.entries(params.switch)
.filter(
([key, value]) => {
if (params.status[key] === value) {
return false
}
return true
})
.map(
([key, value]): SwitchModelParam => (
{
Expand Down

0 comments on commit 5893f85

Please sign in to comment.