Skip to content

Commit

Permalink
fix: altering the words
Browse files Browse the repository at this point in the history
- Made Latest to Newest

Signed-off-by: Akhilender <[email protected]>
  • Loading branch information
akhilender-bongirwar committed Nov 23, 2023
1 parent 658f1b2 commit b172db5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"loadingUsers": "Loading Users...",
"noUserFound": "No User Found",
"sort": "Sort",
"Latest": "Latest First",
"Newest": "Newest First",
"Oldest": "Oldest First",
"filter": "Filter",
"noOrgError": "Organizations not found, please create an organization through dashboard",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"noUserFound": "Aucun utilisateur trouvé",
"sort": "Trier",
"Oldest": "Les plus anciennes d'abord",
"Latest": "Les plus récentes d'abord",
"Newest": "Les plus récentes d'abord",
"filter": "Filtre",
"roleUpdated": "Rôle mis à jour.",
"noResultsFoundFor": "Aucun résultat trouvé pour ",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"noUserFound": "कोई उपयोगकर्ता नहीं मिला।",
"sort": "छांटें",
"Oldest": "सबसे पुराना पहले",
"Latest": "सबसे नवीनतम पहले",
"Newest": "सबसे नवीनतम पहले",
"filter": "फ़िल्टर",
"roleUpdated": "भूमिका अपडेट की गई।",
"noResultsFoundFor": "के लिए कोई परिणाम नहीं मिला ",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/sp.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"noUserFound": "No se encontró ningún usuario.",
"sort": "Ordenar",
"Oldest": "Más Antiguas Primero",
"Latest": "Más Recientes Primero",
"Newest": "Más Recientes Primero",
"filter": "Filtrar",
"roleUpdated": "Rol actualizado.",
"noResultsFoundFor": "No se encontraron resultados para ",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"noUserFound": "找不到用戶。",
"sort": "排序",
"Oldest": "最旧的优先",
"Latest": "最新的优先",
"Newest": "最新的优先",
"filter": "過濾",
"roleUpdated": "角色已更新。",
"noResultsFoundFor": "未找到结果 ",
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Users/Users.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe('Testing Users screen', () => {
);
});

test('Testing sort latest and oldest toggle', async () => {
test('Testing sort Newest and oldest toggle', async () => {
await act(async () => {
render(
<MockedProvider addTypename={false} link={link}>
Expand All @@ -202,7 +202,7 @@ describe('Testing Users screen', () => {
const inputText = screen.getByTestId('sortUsers');

fireEvent.click(inputText);
const toggleText = screen.getByTestId('latest');
const toggleText = screen.getByTestId('newest');

fireEvent.click(toggleText);

Expand Down
10 changes: 5 additions & 5 deletions src/screens/Users/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Users = (): JSX.Element => {
const [hasMore, setHasMore] = useState(true);
const [isLoadingMore, setIsLoadingMore] = useState(false);
const [searchByName, setSearchByName] = useState('');
const [sortingOption, setSortingOption] = useState('latest');
const [sortingOption, setSortingOption] = useState('newest');

const userType = localStorage.getItem('UserType');
const loggedInUserId = localStorage.getItem('id');
Expand Down Expand Up @@ -173,7 +173,7 @@ const Users = (): JSX.Element => {
): InterfaceQueryUserListItem[] => {
const sortedUsers = [...allUsers];

if (sortingOption === 'latest') {
if (sortingOption === 'newest') {
sortedUsers.sort(
(a, b) =>
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
Expand Down Expand Up @@ -242,10 +242,10 @@ const Users = (): JSX.Element => {
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item
onClick={(): void => handleSorting('latest')}
data-testid="latest"
onClick={(): void => handleSorting('newest')}
data-testid="newest"
>
{t('Latest')}
{t('Newest')}
</Dropdown.Item>
<Dropdown.Item
onClick={(): void => handleSorting('oldest')}
Expand Down

0 comments on commit b172db5

Please sign in to comment.