Skip to content

Commit

Permalink
fix: resolves #170 - Show CORS Proxy option only when relevant
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramk committed Nov 13, 2023
1 parent 453cf76 commit 9c61136
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions nerdlets/status-page-dashboard/main-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,23 +688,29 @@ export default class StatusPagesDashboard extends React.PureComponent {

<hr className="or-sep" />

<div className="select-container">
<Checkbox
onChange={this.handleCORSChange}
label="Host requires CORS proxy"
/>
</div>
{hostRequiresProxy && (
<div className="select-container">
<TextFieldWrapper
label="CORS proxy address"
onChange={(event) => {
this.updateInputValue(event, 'corsProxyAddress');
}}
value={corsProxyAddress.inputValue}
validationText={corsProxyAddress.validationText}
/>
</div>
{['nrql', 'workload', ''].includes(providerName.inputValue) ? (
''
) : (
<>
<div className="select-container">
<Checkbox
onChange={this.handleCORSChange}
label="Host requires CORS proxy"
/>
</div>
{hostRequiresProxy && (
<div className="select-container">
<TextFieldWrapper
label="CORS proxy address"
onChange={(event) => {
this.updateInputValue(event, 'corsProxyAddress');
}}
value={corsProxyAddress.inputValue}
validationText={corsProxyAddress.validationText}
/>
</div>
)}
</>
)}

<div className="select-container">
Expand Down

0 comments on commit 9c61136

Please sign in to comment.