Skip to content

Commit a9fadb8

Browse files
authored
Merge pull request #4026 from KelvinTegelaar/dev
Dev to hotfix
2 parents e3c8dfc + 365f70d commit a9fadb8

File tree

9 files changed

+79
-22
lines changed

9 files changed

+79
-22
lines changed

public/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "7.5.2"
2+
"version": "7.5.3"
33
}

src/components/CippCards/CippUniversalSearch.jsx

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,60 @@ export const CippUniversalSearch = React.forwardRef(
6767

6868
CippUniversalSearch.displayName = "CippUniversalSearch";
6969

70-
const Results = ({ items = [], searchValue }) => (
71-
<Grid container spacing={2} mt={2}>
72-
{items.slice(0, 9).map((item, key) => (
73-
<Grid item xs={12} sm={6} md={4} key={key}>
74-
<ResultsRow match={item} searchValue={searchValue} />
70+
const Results = ({ items = [], searchValue }) => {
71+
const [currentPage, setCurrentPage] = useState(1);
72+
const resultsPerPage = 9; // Number of results per page
73+
const totalResults = items.length; // Total number of results
74+
const totalPages = Math.ceil(totalResults / resultsPerPage); // Total pages
75+
76+
// Calculate the results to display for the current page
77+
const startIndex = (currentPage - 1) * resultsPerPage;
78+
const endIndex = startIndex + resultsPerPage;
79+
const displayedResults = items.slice(startIndex, endIndex);
80+
81+
const handleNextPage = () => {
82+
if (currentPage < totalPages) {
83+
setCurrentPage(currentPage + 1);
84+
}
85+
};
86+
87+
const handlePreviousPage = () => {
88+
if (currentPage > 1) {
89+
setCurrentPage(currentPage - 1);
90+
}
91+
};
92+
93+
return (
94+
<>
95+
<Typography variant="body2" color="textSecondary" mt={2}>
96+
{totalResults} results (Page {currentPage} of {totalPages})
97+
</Typography>
98+
<Grid container spacing={2} mt={2}>
99+
{displayedResults.map((item, key) => (
100+
<Grid item xs={12} sm={6} md={4} key={key}>
101+
<ResultsRow match={item} searchValue={searchValue} />
102+
</Grid>
103+
))}
75104
</Grid>
76-
))}
77-
</Grid>
78-
);
105+
<Box display="flex" justifyContent="space-between" mt={2}>
106+
<Button
107+
variant="outlined"
108+
disabled={currentPage === 1}
109+
onClick={handlePreviousPage}
110+
>
111+
Previous
112+
</Button>
113+
<Button
114+
variant="outlined"
115+
disabled={currentPage === totalPages}
116+
onClick={handleNextPage}
117+
>
118+
Next
119+
</Button>
120+
</Box>
121+
</>
122+
);
123+
};
79124

80125
const ResultsRow = ({ match, searchValue }) => {
81126
const highlightMatch = (text) => {
@@ -118,7 +163,7 @@ const ResultsRow = ({ match, searchValue }) => {
118163
href={`identity/administration/users/user?tenantFilter=${
119164
currentTenantInfo.data?.find((tenant) => tenant.customerId === match._tenantId)
120165
?.defaultDomainName || match._tenantId
121-
}&userId=${match.userPrincipalName}`}
166+
}&userId=${match.id}`}
122167
variant="outlined"
123168
color="primary"
124169
size="small"

src/components/CippComponents/CippApiDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export const CippApiDialog = (props) => {
295295
return getNestedValue(row, key) || `[${key}]`;
296296
});
297297

298-
if (linkWithRowData.startsWith("/")) {
298+
if (linkWithRowData.startsWith("/") && !api?.external) {
299299
// Internal link navigation
300300
setLinkClicked(true);
301301
router.push(linkWithRowData, undefined, { shallow: true });

src/components/CippComponents/CippTenantSelector.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const CippTenantSelector = (props) => {
6666
}, [currentTenant?.value]);
6767

6868
useEffect(() => {
69-
if (tenant && currentTenant?.value && currentTenant?.value !== 'AllTenants') {
69+
if (tenant && currentTenant?.value && currentTenant?.value !== "AllTenants") {
7070
tenantDetails.refetch();
7171
}
7272
}, [tenant, offcanvasVisible]);
@@ -85,6 +85,7 @@ export const CippTenantSelector = (props) => {
8585
defaultDomainName: matchingTenant.defaultDomainName,
8686
displayName: matchingTenant.displayName,
8787
customerId: matchingTenant.customerId,
88+
initialDomainName: matchingTenant.initialDomainName,
8889
},
8990
}
9091
: {
@@ -192,12 +193,12 @@ export const CippTenantSelector = (props) => {
192193
actions={[
193194
{
194195
label: "M365 Admin Portal",
195-
link: `https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=o365admincenter`,
196+
link: `https://admin.cloud.microsoft/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
196197
icon: <GlobeAltIcon />,
197198
},
198199
{
199200
label: "Exchange Portal",
200-
link: `https://admin.cloud.microsoft/exchange?landingpage=homepage&form=mac_sidebar&delegatedOrg=${currentTenant?.value}`,
201+
link: `https://admin.cloud.microsoft/exchange?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
201202
icon: <Mail />,
202203
},
203204
{
@@ -207,7 +208,7 @@ export const CippTenantSelector = (props) => {
207208
},
208209
{
209210
label: "Teams Portal",
210-
link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.value}`,
211+
link: `https://admin.teams.microsoft.com/?delegatedOrg=${currentTenant?.addedFields?.initialDomainName}`,
211212
icon: <FilePresent />,
212213
},
213214
{
@@ -222,8 +223,9 @@ export const CippTenantSelector = (props) => {
222223
},
223224
{
224225
label: "SharePoint Portal",
225-
link: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=SharePoint`,
226+
link: `/api/ListSharePointAdminUrl?tenantFilter=${currentTenant?.value}`,
226227
icon: <Share />,
228+
external: true,
227229
},
228230
{
229231
label: "Security Portal",

src/components/CippStandards/CippStandardsSideBar.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const CippStandardsSideBar = ({
142142
name="excludedTenants"
143143
allTenants={false}
144144
formControl={formControl}
145+
includeGroups={true}
145146
/>
146147
</>
147148
)}

src/pages/email/administration/mailbox-rules/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const Page = () => {
7070
title="Rule Details"
7171
propertyItems={properties}
7272
actionItems={actions}
73+
data={data}
7374
/>
7475
);
7576
},

src/pages/identity/administration/users/user/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const Page = () => {
8181
}, [userId]);
8282

8383
const userRequest = ApiGetCall({
84-
url: `/api/ListUsers?UserId=${userId}&tenantFilter=${userSettingsDefaults.currentTenant}`,
84+
url: `/api/ListUsers?UserId=${userId}&tenantFilter=${router.query.tenantFilter ?? userSettingsDefaults.currentTenant}`,
8585
queryKey: `ListUsers-${userId}`,
8686
waiting: waiting,
8787
});

src/pages/teams-share/onedrive/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,21 @@ const Page = () => {
2525
multiple: false,
2626
creatable: false,
2727
api: {
28-
url: "/api/listUsers",
29-
labelField: (onedriveAccessUser) =>
30-
`${onedriveAccessUser.displayName} (${onedriveAccessUser.userPrincipalName})`,
28+
url: "/api/ListGraphRequest",
29+
data: {
30+
Endpoint: "users",
31+
$select: "id,displayName,userPrincipalName",
32+
$top: 999,
33+
$count: true,
34+
},
35+
queryKey: "ListUsersAutoComplete",
36+
dataKey: "Results",
37+
labelField: (user) => `${user.displayName} (${user.userPrincipalName})`,
3138
valueField: "userPrincipalName",
3239
addedField: {
33-
displayName: "displayName",
40+
id: "id",
3441
},
42+
showRefresh: true,
3543
},
3644
},
3745
],

src/utils/get-cipp-formatting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export const getCippFormatting = (data, cellName, type, canReceive, flatten = tr
439439
<CippDataTableButton
440440
tableTitle={getCippTranslation(cellName)}
441441
data={emails.map((email) => {
442-
if (primaryEmail.includes(email)) {
442+
if (primaryEmail && primaryEmail.includes(email)) {
443443
return {
444444
email: email,
445445
primary: true,

0 commit comments

Comments
 (0)