Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table messages for no record #1284

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
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
34 changes: 17 additions & 17 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ npm/npmjs/-/resolve/1.22.8, MIT AND ISC, approved, #15315
npm/npmjs/-/resolve/2.0.0-next.5, MIT AND ISC, approved, #3078
npm/npmjs/-/reusify/1.0.4, MIT, approved, clearlydefined
npm/npmjs/-/rimraf/3.0.2, ISC, approved, clearlydefined
npm/npmjs/-/rollup/4.24.0, MIT, approved, clearlydefined
npm/npmjs/-/rollup/4.24.0, MIT AND (ISC AND MIT), approved, #16917
npm/npmjs/-/run-parallel/1.2.0, MIT, approved, clearlydefined
npm/npmjs/-/safe-array-concat/1.1.2, MIT, approved, clearlydefined
npm/npmjs/-/safe-regex-test/1.0.3, MIT, approved, clearlydefined
Expand Down Expand Up @@ -690,22 +690,22 @@ npm/npmjs/@react-hook/latest/1.0.3, MIT, approved, clearlydefined
npm/npmjs/@reduxjs/toolkit/2.2.7, MIT AND (BSD-2-Clause AND ISC AND MIT) AND Apache-2.0, approved, #14170
npm/npmjs/@remix-run/router/1.19.2, MIT, approved, clearlydefined
npm/npmjs/@rollup/pluginutils/5.1.2, MIT, approved, #16428
npm/npmjs/@rollup/rollup-android-arm-eabi/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm64/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-arm64/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-darwin-x64/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm-gnueabihf/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm-musleabihf/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-gnu/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-arm64-musl/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-powerpc64le-gnu/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-riscv64-gnu/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-s390x-gnu/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-gnu/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-linux-x64-musl/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-arm64-msvc/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-ia32-msvc/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-win32-x64-msvc/4.24.0, MIT, approved, clearlydefined
npm/npmjs/@rollup/rollup-android-arm-eabi/4.24.0, MIT AND (ISC AND MIT), approved, #16904
npm/npmjs/@rollup/rollup-android-arm64/4.24.0, MIT AND (ISC AND MIT), approved, #16918
npm/npmjs/@rollup/rollup-darwin-arm64/4.24.0, MIT AND (ISC AND MIT), approved, #16908
npm/npmjs/@rollup/rollup-darwin-x64/4.24.0, MIT AND (ISC AND MIT), approved, #16901
npm/npmjs/@rollup/rollup-linux-arm-gnueabihf/4.24.0, MIT AND (ISC AND MIT), approved, #16906
npm/npmjs/@rollup/rollup-linux-arm-musleabihf/4.24.0, MIT AND (ISC AND MIT), approved, #16914
npm/npmjs/@rollup/rollup-linux-arm64-gnu/4.24.0, MIT AND (ISC AND MIT), approved, #16910
npm/npmjs/@rollup/rollup-linux-arm64-musl/4.24.0, MIT AND (ISC AND MIT), approved, #16912
npm/npmjs/@rollup/rollup-linux-powerpc64le-gnu/4.24.0, MIT AND (ISC AND MIT), approved, #16916
npm/npmjs/@rollup/rollup-linux-riscv64-gnu/4.24.0, MIT AND (ISC AND MIT), approved, #16907
npm/npmjs/@rollup/rollup-linux-s390x-gnu/4.24.0, MIT AND (ISC AND MIT), approved, #16919
npm/npmjs/@rollup/rollup-linux-x64-gnu/4.24.0, MIT AND (ISC AND MIT), approved, #16915
npm/npmjs/@rollup/rollup-linux-x64-musl/4.24.0, MIT AND (ISC AND MIT), approved, #16911
npm/npmjs/@rollup/rollup-win32-arm64-msvc/4.24.0, MIT AND (ISC AND MIT), approved, #16909
npm/npmjs/@rollup/rollup-win32-ia32-msvc/4.24.0, MIT AND (ISC AND MIT), approved, #16913
npm/npmjs/@rollup/rollup-win32-x64-msvc/4.24.0, MIT AND (ISC AND MIT), approved, #16902
npm/npmjs/@rtsao/scc/1.1.0, MIT, approved, clearlydefined
npm/npmjs/@sinclair/typebox/0.27.8, MIT, approved, clearlydefined
npm/npmjs/@sinonjs/commons/3.0.1, BSD-3-Clause, approved, #12905
Expand Down
4 changes: 4 additions & 0 deletions src/assets/locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,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 @@ -2290,6 +2290,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/actions'
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 @@ -37,6 +37,7 @@ import { type GridEventListener } from '@mui/x-data-grid'
import './RequestListStyle.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 @@ -67,6 +68,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 @@ -156,6 +161,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 @@ -425,6 +429,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
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const CompanyAddressList = ({
searchPlaceholder={t('content.companyData.table.search')}
columnHeadersBackgroundColor={'#FFFFFF'}
searchDebounce={1000}
noRowsMsg={t('content.companyData.table.noRowsMsg')}
noRowsMsg={t('shared.table.emptyTable')}
title={t('content.companyData.table.title')}
getRowId={(row: { [key: string]: string }) => row.createdAt}
rows={inputs.concat(outputs)}
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 @@ -46,6 +46,7 @@ import {
useUnsubscribeServiceMutation,
} from 'features/serviceSubscription/serviceSubscriptionApiSlice'
import { Box } from '@mui/material'
import { PAGES } from 'types/Constants'

interface FetchHookArgsType {
statusId: string
Expand Down Expand Up @@ -75,6 +76,11 @@ export default function CompanySubscriptions() {
const [enableErrorMessage, setEnableErrorMessage] = useState<boolean>(false)
const [currentActive, setCurrentActive] = useState<number>(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 @@ -222,6 +228,7 @@ export default function CompanySubscriptions() {
fetchHookRefresh={refresh}
getRowId={(row: { [key: string]: string }) => row.subscriptionId}
columns={companySubscriptionsCols}
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 @@ -65,6 +65,7 @@ import ConnectorDetailsOverlay from './ConnectorDetailsOverlay'
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
import { Box } from '@mui/material'
import { PAGES } from 'types/Constants'

const EdcConnector = () => {
const { t } = useTranslation()
Expand Down Expand Up @@ -107,6 +108,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 @@ -506,6 +511,7 @@ const EdcConnector = () => {
onCellClick={(params: GridCellParams) => {
onTableCellClick(params)
}}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand All @@ -523,6 +529,7 @@ const EdcConnector = () => {
onCellClick={(params: GridCellParams) => {
onTableCellClick(params)
}}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand Down
11 changes: 10 additions & 1 deletion src/components/pages/IDPManagement/IDPList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
},
}

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

return (
<Table
rowsCount={isManagementOSP ? idpsManagedData?.length : idpsData?.length}
Expand Down Expand Up @@ -461,7 +463,7 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
isManagementOSP ? renderManagementOSPMenu(row) : renderMenu(row),
},
]}
rows={(isManagementOSP ? idpsManagedData : idpsData) ?? []}
rows={rowItems}
getRowId={(row: { [key: string]: string }) => row.identityProviderId}
hasBorder={false}
searchPlaceholder={
Expand All @@ -482,6 +484,13 @@ export const IDPList = ({ isManagementOSP }: { isManagementOSP?: boolean }) => {
onButtonClick={() => dispatch(show(OVERLAYS.ADD_IDP))}
buttonLabel={t('content.onboardingServiceProvider.addIdentityProvider')}
sx={isManagementOSP ? style : undefined}
noRowsMsg={
!rowItems.length
? searchExpr
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
: ''
}
/>
)
}
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 @@ -51,6 +51,7 @@ import { InputType } from 'components/shared/basic/Input/BasicInput'
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 @@ -65,6 +66,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 @@ -398,6 +403,7 @@ const OnboardingServiceProvider = () => {
sortable: false,
},
]}
mappedTableSearchTranslation={mappedTableSearchTranslation}
/>
</div>
</TabPanel>
Expand Down
8 changes: 7 additions & 1 deletion src/components/pages/PartnerNetwork/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ const PartnerNetwork = () => {
loading={loading}
rows={allItems}
rowsCount={allItems?.length}
noRowsMsg={t('content.companyData.table.noRowsMsg')}
nextPage={() => {
setPage(page + 1)
}}
Expand All @@ -179,6 +178,13 @@ const PartnerNetwork = () => {
memberData.meta.page < memberData.meta.totalPages - 1
}
hideFooterPagination={true}
noRowsMsg={
!allItems.length
? expr || bpn
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
: ''
}
/>
</section>
</main>
Expand Down
10 changes: 9 additions & 1 deletion src/components/pages/SemanticHub/ModelTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type SelectedFilter = {
const ModelTable = ({ onModelSelect }: ModelTableProps) => {
const { t } = useTranslation()
const dispatch = useDispatch<AppDispatch>()
const [searchExpr, setSearchExpr] = useState<string>('')
const { modelList, loadingModelList, deleteModelId, uploadedModel, error } =
useSelector(semanticModelsSelector)
const [models, setModels] = useState<SemanticModel[]>([])
Expand Down Expand Up @@ -126,6 +127,7 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
status: selectedFilter.status[0],
}),
}
setSearchExpr(value)
dispatch(fetchSemanticModels({ filter }))
}

Expand Down Expand Up @@ -202,7 +204,13 @@ const ModelTable = ({ onModelSelect }: ModelTableProps) => {
})
)
}
noRowsMsg={t('global.noData.heading')}
noRowsMsg={
!models.length
? searchExpr
? t('shared.table.emptySearchTable')
: t('shared.table.emptyTable')
: ''
}
/>
<div className="load-more-button-container">
{modelList.totalPages !== pageNumber && (
Expand Down
Loading
Loading