Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add mandatory indicators in add service form #173

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 60 additions & 37 deletions nerdlets/status-page-dashboard/main-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,51 +553,71 @@ export default class StatusPagesDashboard extends React.PureComponent {
const providerInput = (() => {
if (providerName.inputValue === PROVIDERS.NRQL.value) {
return (
<TextFieldWrapper
label="NRQL"
placeholder="Put your NRQL query here"
onChange={(event) => {
this.updateInputValue(event, 'nrqlQuery');
}}
value={nrqlQuery.inputValue}
validationText={nrqlQuery.validationText}
/>
<div className="select-container">
<label>
NRQL
<span className="mandatory"> * </span>
</label>
<TextFieldWrapper
placeholder="Put your NRQL query here"
onChange={(event) => {
this.updateInputValue(event, 'nrqlQuery');
}}
value={nrqlQuery.inputValue}
validationText={nrqlQuery.validationText}
/>
</div>
);
} else if (providerName.inputValue === PROVIDERS.WORKLOAD.value) {
return (
<TextFieldWrapper
label="Workload Guid"
placeholder="Put your Workload Entity guid here"
onChange={(event) => {
this.updateInputValue(event, 'workloadGuid');
}}
value={workloadGuid.inputValue}
validationText={workloadGuid.validationText}
/>
<div className="select-container">
<label>
Workload Guid
<span className="mandatory"> * </span>
</label>
<TextFieldWrapper
placeholder="Put your Workload Entity guid here"
onChange={(event) => {
this.updateInputValue(event, 'workloadGuid');
}}
value={workloadGuid.inputValue}
validationText={workloadGuid.validationText}
/>
</div>
);
} else if (providerName.inputValue === PROVIDERS.STATUS_PAL.value) {
return (
<TextFieldWrapper
label="Subdomain"
placeholder="Put your Statuspal subdomain here"
onChange={(event) => {
this.updateInputValue(event, 'subDomain');
}}
value={subDomain.inputValue}
validationText={subDomain.validationText}
/>
<div className="select-container">
<label>
Subdomain
<span className="mandatory"> * </span>
</label>
<TextFieldWrapper
placeholder="Put your Statuspal subdomain here"
onChange={(event) => {
this.updateInputValue(event, 'subDomain');
}}
value={subDomain.inputValue}
validationText={subDomain.validationText}
/>
</div>
);
} else {
return (
<TextFieldWrapper
label="Hostname"
placeholder="https://status.myservice.com/"
onChange={(event) => {
this.updateInputValue(event, 'hostName');
}}
value={hostName.inputValue}
validationText={hostName.validationText}
/>
<div className="select-container">
<label>
Hostname
<span className="mandatory"> * </span>
</label>
<TextFieldWrapper
placeholder="https://status.myservice.com/"
onChange={(event) => {
this.updateInputValue(event, 'hostName');
}}
value={hostName.inputValue}
validationText={hostName.validationText}
/>
</div>
);
}
})();
Expand Down Expand Up @@ -708,7 +728,10 @@ export default class StatusPagesDashboard extends React.PureComponent {
)}

<div className="select-container">
<label>Provider</label>
<label>
Provider
<span className="mandatory"> * </span>
</label>
<select
onChange={this.handleProviderChange}
value={providerName.inputValue}
Expand Down
4 changes: 4 additions & 0 deletions nerdlets/status-page-dashboard/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,10 @@ button[class*='Dropdown-trigger'],
}
}

.mandatory {
color: rgb(232, 16, 16);
}

[class*='InnerModal-content'] {
button[class*='Dropdown-trigger'] {
width: 100%;
Expand Down
Loading