Skip to content
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "7.5.2"
"version": "7.5.3"
}
63 changes: 54 additions & 9 deletions src/components/CippCards/CippUniversalSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,60 @@ export const CippUniversalSearch = React.forwardRef(

CippUniversalSearch.displayName = "CippUniversalSearch";

const Results = ({ items = [], searchValue }) => (
<Grid container spacing={2} mt={2}>
{items.slice(0, 9).map((item, key) => (
<Grid item xs={12} sm={6} md={4} key={key}>
<ResultsRow match={item} searchValue={searchValue} />
const Results = ({ items = [], searchValue }) => {
const [currentPage, setCurrentPage] = useState(1);
const resultsPerPage = 9; // Number of results per page
const totalResults = items.length; // Total number of results
const totalPages = Math.ceil(totalResults / resultsPerPage); // Total pages

// Calculate the results to display for the current page
const startIndex = (currentPage - 1) * resultsPerPage;
const endIndex = startIndex + resultsPerPage;
const displayedResults = items.slice(startIndex, endIndex);

const handleNextPage = () => {
if (currentPage < totalPages) {
setCurrentPage(currentPage + 1);
}
};

const handlePreviousPage = () => {
if (currentPage > 1) {
setCurrentPage(currentPage - 1);
}
};

return (
<>
<Typography variant="body2" color="textSecondary" mt={2}>
{totalResults} results (Page {currentPage} of {totalPages})
</Typography>
<Grid container spacing={2} mt={2}>
{displayedResults.map((item, key) => (
<Grid item xs={12} sm={6} md={4} key={key}>
<ResultsRow match={item} searchValue={searchValue} />
</Grid>
))}
</Grid>
))}
</Grid>
);
<Box display="flex" justifyContent="space-between" mt={2}>
<Button
variant="outlined"
disabled={currentPage === 1}
onClick={handlePreviousPage}
>
Previous
</Button>
<Button
variant="outlined"
disabled={currentPage === totalPages}
onClick={handleNextPage}
>
Next
</Button>
</Box>
</>
);
};

const ResultsRow = ({ match, searchValue }) => {
const highlightMatch = (text) => {
Expand Down Expand Up @@ -118,7 +163,7 @@ const ResultsRow = ({ match, searchValue }) => {
href={`identity/administration/users/user?tenantFilter=${
currentTenantInfo.data?.find((tenant) => tenant.customerId === match._tenantId)
?.defaultDomainName || match._tenantId
}&userId=${match.userPrincipalName}`}
}&userId=${match.id}`}
variant="outlined"
color="primary"
size="small"
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippApiDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const CippApiDialog = (props) => {
return getNestedValue(row, key) || `[${key}]`;
});

if (linkWithRowData.startsWith("/")) {
if (linkWithRowData.startsWith("/") && !api?.external) {
// Internal link navigation
setLinkClicked(true);
router.push(linkWithRowData, undefined, { shallow: true });
Expand Down
12 changes: 7 additions & 5 deletions src/components/CippComponents/CippTenantSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const CippTenantSelector = (props) => {
}, [currentTenant?.value]);

useEffect(() => {
if (tenant && currentTenant?.value && currentTenant?.value !== 'AllTenants') {
if (tenant && currentTenant?.value && currentTenant?.value !== "AllTenants") {
tenantDetails.refetch();
}
}, [tenant, offcanvasVisible]);
Expand All @@ -85,6 +85,7 @@ export const CippTenantSelector = (props) => {
defaultDomainName: matchingTenant.defaultDomainName,
displayName: matchingTenant.displayName,
customerId: matchingTenant.customerId,
initialDomainName: matchingTenant.initialDomainName,
},
}
: {
Expand Down Expand Up @@ -192,12 +193,12 @@ export const CippTenantSelector = (props) => {
actions={[
{
label: "M365 Admin Portal",
link: `https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=o365admincenter`,
link: `https://admin.cloud.microsoft/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
icon: <GlobeAltIcon />,
},
{
label: "Exchange Portal",
link: `https://admin.cloud.microsoft/exchange?landingpage=homepage&form=mac_sidebar&delegatedOrg=${currentTenant?.value}`,
link: `https://admin.cloud.microsoft/exchange?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
icon: <Mail />,
},
{
Expand All @@ -207,7 +208,7 @@ export const CippTenantSelector = (props) => {
},
{
label: "Teams Portal",
link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.value}`,
link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
icon: <FilePresent />,
},
{
Expand All @@ -222,8 +223,9 @@ export const CippTenantSelector = (props) => {
},
{
label: "SharePoint Portal",
link: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=SharePoint`,
link: `/api/ListSharePointAdminUrl?tenantFilter=${currentTenant?.value}`,
icon: <Share />,
external: true,
},
{
label: "Security Portal",
Expand Down
1 change: 1 addition & 0 deletions src/components/CippStandards/CippStandardsSideBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const CippStandardsSideBar = ({
name="excludedTenants"
allTenants={false}
formControl={formControl}
includeGroups={true}
/>
</>
)}
Expand Down
1 change: 1 addition & 0 deletions src/pages/email/administration/mailbox-rules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const Page = () => {
title="Rule Details"
propertyItems={properties}
actionItems={actions}
data={data}
/>
);
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/identity/administration/users/user/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Page = () => {
}, [userId]);

const userRequest = ApiGetCall({
url: `/api/ListUsers?UserId=${userId}&tenantFilter=${userSettingsDefaults.currentTenant}`,
url: `/api/ListUsers?UserId=${userId}&tenantFilter=${router.query.tenantFilter ?? userSettingsDefaults.currentTenant}`,
queryKey: `ListUsers-${userId}`,
waiting: waiting,
});
Expand Down
16 changes: 12 additions & 4 deletions src/pages/teams-share/onedrive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ const Page = () => {
multiple: false,
creatable: false,
api: {
url: "/api/listUsers",
labelField: (onedriveAccessUser) =>
`${onedriveAccessUser.displayName} (${onedriveAccessUser.userPrincipalName})`,
url: "/api/ListGraphRequest",
data: {
Endpoint: "users",
$select: "id,displayName,userPrincipalName",
$top: 999,
$count: true,
},
queryKey: "ListUsersAutoComplete",
dataKey: "Results",
labelField: (user) => `${user.displayName} (${user.userPrincipalName})`,
valueField: "userPrincipalName",
addedField: {
displayName: "displayName",
id: "id",
},
showRefresh: true,
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-cipp-formatting.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export const getCippFormatting = (data, cellName, type, canReceive, flatten = tr
<CippDataTableButton
tableTitle={getCippTranslation(cellName)}
data={emails.map((email) => {
if (primaryEmail.includes(email)) {
if (primaryEmail && primaryEmail.includes(email)) {
return {
email: email,
primary: true,
Expand Down