fix: Translate "None" option in automation select (#11076)

# Pull Request Template

## Description

This PR includes a translation update for the "None" option in the
automation select for both agents and teams

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)



## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
This commit is contained in:
Sivin Varghese
2025-03-14 05:14:46 +05:30
committed by GitHub
parent 557df5c5c9
commit a8001ccabc
4 changed files with 60 additions and 13 deletions

View File

@@ -16,7 +16,6 @@ import {
export default function useAutomationValues() {
const getters = useStoreGetters();
const { t } = useI18n();
const agents = useMapGetter('agents/getAgents');
const campaigns = useMapGetter('campaigns/getAllCampaigns');
const contacts = useMapGetter('contacts/getContacts');
@@ -61,6 +60,19 @@ export default function useAutomationValues() {
];
});
/**
* Adds a translated "None" option to the beginning of a list
* @param {Array} list - The list to add "None" to
* @returns {Array} A new array with "None" option at the beginning
*/
const addNoneToList = list => [
{
id: 'nil',
name: t('AUTOMATION.NONE_OPTION') || 'None',
},
...(list || []),
];
/**
* Gets the condition dropdown values for a given type.
* @param {string} type - The type of condition.
@@ -95,6 +107,7 @@ export default function useAutomationValues() {
slaPolicies: slaPolicies.value,
languages,
type,
addNoneToListFn: addNoneToList,
});
};