Skip to content

Commit 9eba25e

Browse files
committed
chore: merge conflict resolution
1 parent 64d9d86 commit 9eba25e

File tree

11 files changed

+73
-18
lines changed

11 files changed

+73
-18
lines changed

src/assets/locales/de/main.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,9 @@
24562456
},
24572457
"table": {
24582458
"search": "Enter email to search",
2459-
"searchName": "Enter name to search"
2459+
"searchName": "Enter name to search",
2460+
"emptyDataMsg": "Keine Einträge vorhanden.\nEinträge werden hier angezeigt, sobald sie hinzugefügt werden.",
2461+
"noSearchResults": "Keine Ergebnisse gefunden.\nBitte versuchen Sie es mit anderen Suchbegriffen."
24602462
},
24612463
"noData": {
24622464
"heading": "No data available",

src/assets/locales/en/main.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,9 @@
24562456
},
24572457
"table": {
24582458
"search": "Enter email to search",
2459-
"searchName": "Enter name to search"
2459+
"searchName": "Enter name to search",
2460+
"emptyDataMsg": "No items to display.\nItems will appear here once they are added.",
2461+
"noSearchResults": "No results found.\nPlease try again with different keywords."
24602462
},
24612463
"noData": {
24622464
"heading": "No data available",

src/components/overlays/AddAppUserRoles/UserListContent.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default function UserListContent() {
6666
onSelection={(id: GridRowId[]) => {
6767
dispatch(setSelectedUserToAdd(id))
6868
}}
69-
noRowsMsg={t('content.usermanagement.table.noRowsMsg')}
7069
title={t('content.usermanagement.table.title')}
7170
loadLabel={t('global.actions.loadmore')}
7271
fetchHook={useFetchAppUsersSearchQuery}

src/components/pages/AppOverview/AddRoles.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default function AddRoles() {
6161
const navigate = useNavigate()
6262
const appId = useParams().appId
6363
const [isLoading, setIsLoading] = useState(false)
64+
const [noRowsMsg, setNoRowsMsg] = useState<string>('')
6465
const { state } = useLocation()
6566
const items = state
6667
const app = items?.filter((item: ItemType) => item.id === appId)
@@ -74,6 +75,14 @@ export default function AddRoles() {
7475
[`${(<Checkbox disabled={true} />)}`],
7576
])
7677

78+
const appRolesData =
79+
data && data.length > 0
80+
? appRoles.map((item, i) => ({
81+
establishedRoles: item[0],
82+
id: i,
83+
}))
84+
: []
85+
7786
useEffect(() => {
7887
refetch()
7988
}, [state])
@@ -91,13 +100,11 @@ export default function AddRoles() {
91100
)
92101
}, [data])
93102

94-
const appRolesData =
95-
data && data.length > 0
96-
? appRoles.map((item, i) => ({
97-
establishedRoles: item[0],
98-
id: i,
99-
}))
100-
: []
103+
useEffect(() => {
104+
if (appRolesData && appRolesData.length === 0) {
105+
setNoRowsMsg(t('global.table.emptyDataMsg'))
106+
}
107+
}, [appRolesData])
101108

102109
const columns = [
103110
{
@@ -194,6 +201,7 @@ export default function AddRoles() {
194201
rows={appRolesData}
195202
getRowId={(row) => uniqueId(row.urn)}
196203
hasBorder={false}
204+
noRowsMsg={noRowsMsg}
197205
/>
198206
</Box>
199207
</div>

src/components/pages/CompanyData/CompanyAddressList.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
********************************************************************************/
1919

2020
import { Chip, IconButton, Table } from '@catena-x/portal-shared-components'
21-
import { useEffect, useState } from 'react'
21+
import { useEffect, useMemo, useState } from 'react'
2222
import { useDispatch, useSelector } from 'react-redux'
2323
import { Box } from '@mui/material'
2424
import { useTranslation } from 'react-i18next'
@@ -60,6 +60,7 @@ export const CompanyAddressList = ({
6060
handleConfirm: () => void
6161
}) => {
6262
const { t } = useTranslation()
63+
const [noRowsMsg, setNoRowsMsg] = useState<string>('')
6364
const [page, setPage] = useState<number>(0)
6465
const {
6566
data,
@@ -80,6 +81,8 @@ export const CompanyAddressList = ({
8081
const dispatch = useDispatch()
8182
const refetch = useSelector(companyRefetch)
8283

84+
const rows = useMemo(() => inputs.concat(outputs), [inputs, outputs])
85+
8386
const getInputItems = async () => {
8487
const params = sharingStates
8588
?.filter(
@@ -139,6 +142,12 @@ export const CompanyAddressList = ({
139142
}
140143
}, [data])
141144

145+
useEffect(() => {
146+
if (rows && rows.length === 0) {
147+
setNoRowsMsg(t('global.table.emptyDataMsg'))
148+
}
149+
}, [rows])
150+
142151
const getStatus = (id: string) =>
143152
sharingStates?.filter((state) => id === state.externalId)[0]
144153
?.sharingStateType
@@ -212,9 +221,7 @@ export const CompanyAddressList = ({
212221
columnHeadersBackgroundColor={'#FFFFFF'}
213222
searchDebounce={1000}
214223
noRowsMsg={
215-
!isFetching && !isOutputLoading && !isInputLoading
216-
? t('content.companyData.table.noRowsMsg')
217-
: ''
224+
!isFetching && !isOutputLoading && !isInputLoading ? noRowsMsg : ''
218225
}
219226
title={t('content.companyData.table.title')}
220227
getRowId={(row: { [key: string]: string }) => row.createdAt}

src/components/pages/EdcConnector/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ const EdcConnector = () => {
517517
fetchHookRefresh={refresh}
518518
getRowId={(row: { [key: string]: string }) => row.id}
519519
columns={managedConnectorCols}
520-
noRowsMsg={t('content.edcconnector.noConnectorsMessage')}
521520
onCellClick={(params: GridCellParams) => {
522521
onTableCellClick(params)
523522
}}

src/components/pages/IDPManagement/IDPList.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
8888

8989
const [disableLoading, setDisableLoading] = useState(false)
9090
const [deleteLoading, setDeleteLoading] = useState(false)
91+
const [noRowsMsg, setNoRowsMsg] = useState<string>('')
9192

9293
const { data, isFetching } = useFetchIDPListQuery()
9394
const idpsData = data
@@ -107,6 +108,13 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
107108
setIdpsManagedData(managedIdpsData)
108109
}, [data])
109110

111+
useEffect(() => {
112+
const dataRows = isManagementOSP ? idpsManagedData : idpsData
113+
if (dataRows && dataRows.length === 0) {
114+
setNoRowsMsg(t('global.table.emptyDataMsg'))
115+
}
116+
}, [isManagementOSP, idpsData, idpsManagedData])
117+
110118
const doDelete = async (
111119
e: React.MouseEvent<HTMLElement, MouseEvent>,
112120
idp: IdentityProvider
@@ -474,6 +482,7 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
474482
rows={(isManagementOSP ? idpsManagedData : idpsData) ?? []}
475483
getRowId={(row: { [key: string]: string }) => row.identityProviderId}
476484
hasBorder={false}
485+
noRowsMsg={noRowsMsg}
477486
searchPlaceholder={
478487
isManagementOSP
479488
? t('content.onboardingServiceProvider.search')

src/components/pages/PartnerNetwork/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const PartnerNetwork = () => {
4747
const { t } = useTranslation()
4848
const [expr, setExpr] = useState<string>('')
4949
const [bpn, setBpn] = useState<string>('')
50+
const [noRowsMsg, setNoRowsMsg] = useState<string>('')
5051
const searchInputData = useSelector(updatePartnerSelector)
5152
const columns = PartnerNetworksTableColumns(t)
5253
const [mutationRequest] = useFetchBusinessPartnerAddressMutation()
@@ -89,6 +90,16 @@ const PartnerNetwork = () => {
8990
if (data && data.length > 0) fetchAllMembers()
9091
}, [data, fetchArgs])
9192

93+
useEffect(() => {
94+
if (allItems) {
95+
if (!(expr || bpn) && allItems.length === 0) {
96+
setNoRowsMsg(t('global.table.emptyDataMsg'))
97+
} else if ((expr || bpn) && allItems.length === 0) {
98+
setNoRowsMsg(t('global.table.noSearchResults'))
99+
}
100+
}
101+
}, [allItems, expr, bpn])
102+
92103
const setCountryAttributes = (payload: PaginResult<BusinessPartner>) => {
93104
let finalObj = JSON.parse(JSON.stringify(payload?.content))
94105
finalObj = addCountryAttribute(
@@ -171,7 +182,7 @@ const PartnerNetwork = () => {
171182
loading={loading}
172183
rows={allItems}
173184
rowsCount={allItems?.length}
174-
noRowsMsg={t('content.companyData.table.noRowsMsg')}
185+
noRowsMsg={noRowsMsg}
175186
nextPage={() => {
176187
setPage(page + 1)
177188
}}

src/components/pages/SemanticHub/ModelTable.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
5151
const [selectedFilter, setSelectedFilter] = useState<SelectedFilter>({
5252
status: [DefaultStatus],
5353
})
54+
const [noRowsMsg, setNoRowsMsg] = useState<string>('')
5455
const rowCount = 10
5556
const filter = [
5657
{
@@ -94,6 +95,16 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
9495

9596
const { uploadedModel } = useSelector(semanticModelsSelector)
9697

98+
useEffect(() => {
99+
if (models) {
100+
if (!searchValue && models.length === 0) {
101+
setNoRowsMsg(t('global.table.emptyDataMsg'))
102+
} else if (searchValue && models.length === 0) {
103+
setNoRowsMsg(t('global.table.noSearchResults'))
104+
}
105+
}
106+
}, [models, searchValue])
107+
97108
useEffect(() => {
98109
if (modelList) {
99110
if (pageNumber === 0) {
@@ -156,6 +167,7 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
156167
<section>
157168
<Table
158169
autoFocus={false}
170+
searchExpr={searchValue}
159171
rowsCount={modelList?.totalItems}
160172
hideFooter
161173
loading={loadingModelList}
@@ -184,7 +196,7 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
184196
reload={() => {
185197
setPageNumber(0)
186198
}}
187-
noRowsMsg={t('global.noData.heading')}
199+
noRowsMsg={noRowsMsg}
188200
/>
189201
<div className="load-more-button-container">
190202
{modelList?.totalPages !== pageNumber && (

src/components/shared/frame/UserList/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ export const UserList = ({
120120
onSearch(expr)
121121
}}
122122
searchDebounce={1000}
123-
noRowsMsg={t('content.usermanagement.appUserDetails.table.noRowsMsg')}
124123
title={t(tableLabel)}
125124
loadLabel={t('global.actions.more')}
126125
fetchHook={fetchHook}

0 commit comments

Comments
 (0)