Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,10 @@
"title": "Assigned Catena-X Portal Roles",
"changeRoleBtn": "Change Portal Role",
"errorMsg": "Sie sind nicht berechtigt, Ihre eigenen Administrator-Rollen zu ändern. Bitte wenden Sie sich an einen anderen Administrator."
},
"table": {
"emptySearchTable": "Keine Ergebnisse gefunden",
"emptyTable": "Keine Einträge vorhanden"
}
},
"global": {
Expand Down
4 changes: 4 additions & 0 deletions src/assets/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2369,6 +2369,10 @@
"title": "Assigned Catena-X Portal Roles",
"changeRoleBtn": "Change Portal Role",
"errorMsg": "You are not authorized to change your own admin roles. Please contact another admin."
},
"table": {
"emptySearchTable": "No results found",
"emptyTable": "No items to display"
}
},
"global": {
Expand Down
6 changes: 6 additions & 0 deletions src/components/overlays/AddAppUserRoles/UserListContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { updatePartnerSelector } from 'features/control/updates'
import { setSelectedUserToAdd } from 'features/admin/userDeprecated/slice'
import Patterns from 'types/Patterns'
import { useFetchAppUsersSearchQuery } from 'features/admin/appuserApiSlice'
import { PAGES } from 'types/Constants'

interface FetchHookArgsType {
appId: string | undefined
Expand All @@ -42,6 +43,10 @@ export default function UserListContent() {
const dispatch = useDispatch()

const { appId } = useParams()
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const [expr, setExpr] = useState<string>('')
const [refresh, setRefresh] = useState<number>(0)
Expand Down Expand Up @@ -94,6 +99,7 @@ export default function UserListContent() {
},
]}
checkboxSelection
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { type GridEventListener } from '@mui/x-data-grid'
import './style.scss'
import { refetch } from 'features/admin/registration/slice'
import { isCompanyName } from 'types/Patterns'
import { PAGES } from 'types/Constants'

interface FetchHookArgsType {
statusFilter: string
Expand Down Expand Up @@ -65,6 +66,10 @@ export const RequestList = ({
const [filterStatus, setFilterStatus] = useState<string>(
AppFilterType.INREVIEW
)
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}
const [fetchHookArgs, setFetchHookArgs] = useState<FetchHookArgsType>()
const setView = (e: React.MouseEvent<HTMLInputElement>) => {
const viewValue = e.currentTarget.value
Expand Down Expand Up @@ -154,6 +159,7 @@ export const RequestList = ({
)}${t('content.admin.registration-requests.introText2')}`}
defaultFilter={group}
filterViews={filterView}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</section>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
StatusTag,
Tooltips,
} from '@catena-x/portal-shared-components'
import { ROLES } from 'types/Constants'
import { PAGES, ROLES } from 'types/Constants'
import SettingsBackupRestoreIcon from '@mui/icons-material/SettingsBackupRestore'
import { userHasSsiCredentialRole } from 'services/AccessService'

Expand Down Expand Up @@ -97,6 +97,10 @@ export default function AdminCredentialElements() {
const [approveCredential] = useApproveCredentialMutation()
const [declineCredential] = useDeclineCredentialMutation()
const [revokeCredential] = useRevokeCredentialMutation()
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const setView = (e: React.MouseEvent<HTMLInputElement>) => {
const viewValue = e.currentTarget.value
Expand Down Expand Up @@ -436,6 +440,7 @@ export default function AdminCredentialElements() {
setSortOption(value)
}}
disableColumnSelector={true}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</>
Expand Down
1 change: 1 addition & 0 deletions src/components/pages/AppOverview/AddRoles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default function AddRoles() {
rows={appRolesData}
getRowId={(row) => uniqueId(row.urn)}
hasBorder={false}
noRowsMsg={t('shared.table.emptyTable')}
/>
</Box>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/CompanyData/CompanyAddressList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export const CompanyAddressList = ({
searchDebounce={1000}
noRowsMsg={
!isFetching && !isOutputLoading && !isInputLoading
? t('content.companyData.table.noRowsMsg')
? t('shared.table.emptyTable')
: ''
}
title={t('content.companyData.table.title')}
Expand Down
7 changes: 7 additions & 0 deletions src/components/pages/CompanySubscriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
} from 'features/serviceSubscription/serviceSubscriptionApiSlice'
import { Box } from '@mui/material'
import { useLocation } from 'react-router-dom'
import { PAGES } from 'types/Constants'

interface FetchHookArgsType {
statusId: string
Expand Down Expand Up @@ -79,6 +80,11 @@ export default function CompanySubscriptions() {
location.state?.activeTab ?? 0
)

const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const setView = (e: React.MouseEvent<HTMLInputElement>) => {
const viewValue = e.currentTarget.value
setFilterStatus(viewValue)
Expand Down Expand Up @@ -229,6 +235,7 @@ export default function CompanySubscriptions() {
onClearSearch={() => {
setSearchExpr('')
}}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
)
Expand Down
7 changes: 7 additions & 0 deletions src/components/pages/EdcConnector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
import { Box } from '@mui/material'
import { ProvidedConnectorTableColumns } from './edcProvidedConnectorTableColumns'
import { PAGES } from 'types/Constants'

const EdcConnector = () => {
const { t } = useTranslation()
Expand Down Expand Up @@ -109,6 +110,10 @@ const EdcConnector = () => {
const [notificationMessage, setNotificationMessage] = useState<string>(
t('content.edcconnector.snackbar.successmessage')
)
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}
const [
viewConfigurationDetailsOverlayOpen,
setViewConfigurationDetailsOverlayOpen,
Expand Down Expand Up @@ -504,6 +509,7 @@ const EdcConnector = () => {
onCellClick={(params: GridCellParams) => {
onTableCellClick(params)
}}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand All @@ -521,6 +527,7 @@ const EdcConnector = () => {
onCellClick={(params: GridCellParams) => {
onTableCellClick(params)
}}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand Down
16 changes: 14 additions & 2 deletions src/components/pages/IDPManagement/IDPList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

import { useEffect, useState } from 'react'
import { useEffect, useMemo, useState } from 'react'
import { useDispatch } from 'react-redux'
import { useTranslation } from 'react-i18next'
import { MenuItem } from '@mui/material'
Expand Down Expand Up @@ -394,6 +394,17 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
)
}

const rowItems = (isManagementOSP ? idpsManagedData : idpsData) ?? []

const getNoRowsMessage = useMemo(() => {
if (!rowItems.length) {
return searchExpr
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
}
return ''
}, [rowItems, searchExpr, t])

return (
<Table
rowsCount={isManagementOSP ? idpsManagedData?.length : idpsData?.length}
Expand All @@ -405,6 +416,7 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
disableColumnSelector={true}
disableDensitySelector={true}
columnHeadersBackgroundColor={'#ffffff'}
rows={rowItems}
title={
isManagementOSP
? t('content.onboardingServiceProvider.ospIdentityProvider')
Expand Down Expand Up @@ -471,7 +483,6 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
isManagementOSP ? renderManagementOSPMenu(row) : renderMenu(row),
},
]}
rows={(isManagementOSP ? idpsManagedData : idpsData) ?? []}
getRowId={(row: { [key: string]: string }) => row.identityProviderId}
hasBorder={false}
searchPlaceholder={
Expand All @@ -491,6 +502,7 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
searchDebounce={isManagementOSP ? 1000 : undefined}
onButtonClick={() => dispatch(show(OVERLAYS.ADD_IDP))}
buttonLabel={t('content.onboardingServiceProvider.addIdentityProvider')}
noRowsMsg={getNoRowsMessage}
sx={{
'.MuiDataGrid-cell': {
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import dayjs from 'dayjs'
import { setSearchInput } from 'features/appManagement/actions'
import { updateInviteSelector } from 'features/control/updates'
import { isCompanyName } from 'types/Patterns'
import { PAGES } from 'types/Constants'

interface FetchHookArgsType {
expr: string
Expand All @@ -57,6 +58,10 @@ export const InviteList = ({
const dispatch = useDispatch()
const [refresh, setRefresh] = useState<number>(0)
const searchInputData = useSelector(updateInviteSelector)
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const validateSearchText = (expr: string) => {
const validateExpr = isCompanyName(expr)
Expand Down Expand Up @@ -135,6 +140,7 @@ export const InviteList = ({
),
},
]}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</section>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { isIDPClientID, isIDPClientSecret, isURL } from 'types/Patterns'
import { type IHashMap } from 'types/MainTypes'
import { success } from 'services/NotifyService'
import WarningAmberIcon from '@mui/icons-material/WarningAmber'
import { PAGES } from 'types/Constants'

const OnboardingServiceProvider = () => {
const { t } = useTranslation()
Expand All @@ -64,6 +65,10 @@ const OnboardingServiceProvider = () => {
const [callbackData, setCallbackData] = useState<
RegistartionStatusCallbackType | undefined
>(undefined)
const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const handleTabChange = (
_e: SyntheticEvent<Element, Event>,
Expand Down Expand Up @@ -404,6 +409,7 @@ const OnboardingServiceProvider = () => {
sortable: false,
},
]}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand Down
13 changes: 11 additions & 2 deletions src/components/pages/PartnerNetwork/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
type PaginResult,
} from '@catena-x/portal-shared-components'
import { useSelector } from 'react-redux'
import { useEffect, useState } from 'react'
import { useEffect, useState, useMemo } from 'react'
import { updatePartnerSelector } from 'features/control/updates'
import { PartnerNetworksTableColumns } from 'components/pages/PartnerNetwork/partnerNetworkTableColumns'
import type { BusinessPartner } from 'features/newPartnerNetwork/types'
Expand Down Expand Up @@ -134,6 +134,15 @@ const PartnerNetwork = () => {
fetchAndApply([bpn])
}, [bpn])

const getNoRowsMessage = useMemo(() => {
if (!allItems.length) {
return expr || bpn
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
}
return ''
}, [allItems, expr, bpn, t])

return (
<main className="partner-network-page-container">
<PageHeader
Expand Down Expand Up @@ -171,7 +180,6 @@ const PartnerNetwork = () => {
loading={loading}
rows={allItems}
rowsCount={allItems?.length}
noRowsMsg={t('content.companyData.table.noRowsMsg')}
nextPage={() => {
setPage(page + 1)
}}
Expand All @@ -180,6 +188,7 @@ const PartnerNetwork = () => {
memberData.meta.page < memberData.meta.totalPages - 1
}
hideFooterPagination={true}
noRowsMsg={getNoRowsMessage}
/>
</section>
</main>
Expand Down
13 changes: 11 additions & 2 deletions src/components/pages/SemanticHub/ModelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
type SemanticModel,
DefaultStatus,
} from 'features/semanticModels/types'
import { useState, useEffect } from 'react'
import { useState, useEffect, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import { LoadMoreButton } from '../../shared/basic/LoadMoreButton'
import { SemanticModelTableColumns } from './SemanticModelTableColumn'
Expand Down Expand Up @@ -152,6 +152,15 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
: t('global.errors.loadFailed')
}

const getNoRowsMessage = useMemo(() => {
if (!models.length) {
return searchValue
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
}
return ''
}, [models, searchValue, t])

return (
<section>
<Table
Expand Down Expand Up @@ -184,7 +193,7 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
reload={() => {
setPageNumber(0)
}}
noRowsMsg={t('global.noData.heading')}
noRowsMsg={getNoRowsMessage}
/>
<div className="load-more-button-container">
{modelList?.totalPages !== pageNumber && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import {
IconButton,
PageLoadingTable,
StatusTag,
PageLoadingTable,
} from '@catena-x/portal-shared-components'
import { useTranslation } from 'react-i18next'
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
Expand Down Expand Up @@ -54,6 +54,12 @@ export const TechnicalUserTable = () => {
const [group, setGroup] = useState<string>(
ServiceAccountStatusFilter.SHOW_ALL
)

const mappedTableSearchTranslation = {
[PAGES.NO_SEARCH_TABLE_DATA]: t('shared.table.emptySearchTable'),
[PAGES.NO_TABLE_DATA]: t('shared.table.emptyTable'),
}

const setView = (e: React.MouseEvent<HTMLInputElement>) => {
const viewValue = e.currentTarget.value
setGroup(viewValue)
Expand Down Expand Up @@ -208,6 +214,7 @@ export const TechnicalUserTable = () => {
),
},
]}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
)
Expand Down
Loading
Loading