Sentence case for Select targets, All hosts, Linux (#2219)

This commit is contained in:
RachelElysia 2021-09-24 15:09:15 -04:00 committed by GitHub
parent d81a6317a0
commit fc19722ec2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,17 +47,30 @@ const TargetPillSelector = ({
entity,
isSelected,
onClick,
}: ITargetPillSelectorProps): JSX.Element => (
<button
className="target-pill-selector"
data-selected={isSelected}
onClick={(e) => onClick(entity)(e)}
>
<img alt="" src={isSelected ? CheckIcon : PlusIcon} />
<span className="selector-name">{entity.display_text}</span>
<span className="selector-count">{entity.count}</span>
</button>
);
}: ITargetPillSelectorProps): JSX.Element => {
const displayText = () => {
switch (entity.display_text) {
case "All Hosts":
return "All hosts";
case "All Linux":
return "Linux";
default:
return entity.display_text;
}
};
return (
<button
className="target-pill-selector"
data-selected={isSelected}
onClick={(e) => onClick(entity)(e)}
>
<img alt="" src={isSelected ? CheckIcon : PlusIcon} />
<span className="selector-name">{displayText()}</span>
<span className="selector-count">{entity.count}</span>
</button>
);
};
const SelectTargets = ({
baseClass,
@ -228,7 +241,7 @@ const SelectTargets = ({
if (isEmpty(searchText) && isTargetsLoading) {
return (
<div className={`${baseClass}__wrapper body-wrap`}>
<h1>Select Targets</h1>
<h1>Select targets</h1>
<div className={`${baseClass}__page-loading`}>
<Spinner />
</div>
@ -239,7 +252,7 @@ const SelectTargets = ({
if (isEmpty(searchText) && isTargetsError) {
return (
<div className={`${baseClass}__wrapper body-wrap`}>
<h1>Select Targets</h1>
<h1>Select targets</h1>
<div className={`${baseClass}__page-error`}>
<h4>
<img alt="" src={ErrorIcon} />
@ -264,7 +277,7 @@ const SelectTargets = ({
return (
<div className={`${baseClass}__wrapper body-wrap`}>
<h1>Select Targets</h1>
<h1>Select targets</h1>
<div className={`${baseClass}__target-selectors`}>
{allHostsLabels &&
allHostsLabels.length > 0 &&