INFRA-2867 | make options sorted

This commit is contained in:
dhruvjoshi
2024-03-13 16:43:22 +05:30
parent 01e09622b5
commit cfa0ede617
5 changed files with 9 additions and 6 deletions

View File

@@ -155,7 +155,7 @@
}
}
.create-incident-single-selector {
width: 321px !important;
width: 319px !important;
min-height: unset;
}
.create-incident-single-selector + div {

View File

@@ -184,7 +184,7 @@ const CreateIncidentForm: React.FC<CreateIncidentFormProps> = ({
<div className={styles['Team-wrapper']}>
<div className={styles['name-wrapper']}>Product</div>
<ProductSelector
options={state.teams}
options={state?.teams}
handleSelectionChange={handleTeamChange}
selected={state.selectedTeam}
/>

View File

@@ -15,12 +15,15 @@ const IncidentSingleSelector: React.FC<IncidentSingleSelectorProps> = (
props: IncidentSingleSelectorProps,
) => {
const { options, handleSelectionChange, selected, disabled = false } = props;
const sortedOptions = options
?.slice()
.sort?.((a, b) => a?.label?.localeCompare(b?.label));
const handleClearCallback = (): void => {
handleSelectionChange('');
};
return (
<SingleSelectAutoComplete
options={options}
options={sortedOptions}
selectedOption={selected}
updateSelectedOptions={handleSelectionChange}
updateClearAllCallback={handleClearCallback}

View File

@@ -89,7 +89,6 @@ const SearchResultsTable: FC<SearchResultTableProps> = ({
if (!products || products.length === 0) return '';
const productNames = products
?.map((product: Team) => product.label)
?.sort((a, b) => a.length - b.length)
?.join(', ');
if (productNames.length <= MAX_LENGTH) return productNames;

View File

@@ -71,8 +71,9 @@ const Dropdowns: FC = () => {
const updatedSeverities = generateOptions(headerData?.severities);
const updatedStatuses = generateOptions(headerData?.incidentStatuses);
const updatedTeams = useSelector(selectAssignerResponderData)?.assignerTeam
?.teams;
const updatedTeams = useSelector(selectAssignerResponderData)
?.assignerTeam?.teams?.slice()
?.sort?.((a, b) => a?.label?.localeCompare(b?.label));
const initialSeverity = {
label: incidentData?.severityName,
value: incidentData?.severityId,