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