1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #~: Fix minor to header translates (#1710)

(cherry picked from commit 44e27be8c67a3c04c768efaba0d4ec1b14e23527)
This commit is contained in:
Sergio Betanzos 2022-01-20 11:54:59 +01:00 committed by Tino Vazquez
parent b927161902
commit 500219e637
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -22,7 +22,7 @@ import { Group as GroupIcon, VerifiedBadge as SelectIcon } from 'iconoir-react'
import { useAuth, useAuthApi } from 'client/features/Auth'
import Search from 'client/components/Search'
import HeaderPopover from 'client/components/Header/Popover'
import { Translate } from 'client/components/HOC'
import { Tr, Translate } from 'client/components/HOC'
import { T, FILTER_POOL } from 'client/constants'
const { ALL_RESOURCES, PRIMARY_GROUP_RESOURCES } = FILTER_POOL
@ -73,12 +73,11 @@ const Group = () => {
const sortGroupAsMainFirst = (a, b) =>
a.ID === user?.GUID ? -1 : b.ID === user?.GUID ? 1 : 0
const ShowAllOption = { ID: ALL_RESOURCES, NAME: Tr(T.ShowAll) }
const sortMainGroupFirst = useMemo(
() =>
[{ ID: ALL_RESOURCES, NAME: <Translate word={T.ShowAll} /> }]
?.concat(groups)
?.sort(sortGroupAsMainFirst),
[user?.GUID]
() => [ShowAllOption].concat(groups).sort(sortGroupAsMainFirst),
[user?.GUID, ShowAllOption?.NAME]
)
return (