Skip to content

Commit 4a94178

Browse files
authored
Merge pull request #3116 from JohnDuprey/dev
display tweaks
2 parents 1de8142 + de237fe commit 4a94178

File tree

9 files changed

+74
-28
lines changed

9 files changed

+74
-28
lines changed

src/components/CippCards/CippInfoBar.jsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Card, Stack, SvgIcon, Typography, Skeleton } from "@mui/material";
1+
import { Box, Card, Stack, SvgIcon, Typography, Skeleton } from "@mui/material";
22
import Grid from "@mui/material/Grid";
33

44
export const CippInfoBar = ({ data, isFetching }) => (
@@ -31,17 +31,25 @@ export const CippInfoBar = ({ data, isFetching }) => (
3131
}}
3232
>
3333
<Stack alignItems="center" direction="row" spacing={2} sx={{ p: 2 }}>
34-
<SvgIcon color={item.color ? item.color : "primary"} fontSize="small">
35-
{item.icon}
36-
</SvgIcon>
37-
<div>
34+
{item?.icon && (
35+
<SvgIcon color={item.color ? item.color : "primary"} fontSize="small">
36+
{item.icon}
37+
</SvgIcon>
38+
)}
39+
<Box
40+
sx={() => {
41+
if (!item?.icon) {
42+
return { pl: 2 };
43+
}
44+
}}
45+
>
3846
<Typography color="text.secondary" variant="overline">
3947
{item.name}
4048
</Typography>
4149
<Typography variant="h6">
4250
{isFetching ? <Skeleton width={"100%"} /> : item.data}
4351
</Typography>
44-
</div>
52+
</Box>
4553
</Stack>
4654
</Grid>
4755
))}

src/components/CippCards/CippPropertyListCard.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ export const CippPropertyListCard = (props) => {
3939
const firstHalf = propertyItems.slice(0, half);
4040
const secondHalf = propertyItems.slice(half, propertyItems.length);
4141

42+
const isLabelPresent = (item) => {
43+
return item?.label === "" || item?.label === undefined || item?.label === null;
44+
};
45+
46+
const setPadding = isLabelPresent ? { py: 0.5, px: 3 } : { py: 1.5, px: 3 };
47+
4248
return (
4349
<>
4450
<Card sx={cardSx} {...other}>
@@ -56,6 +62,7 @@ export const CippPropertyListCard = (props) => {
5662
align={align}
5763
label={item.label}
5864
value={<Skeleton width={280} />}
65+
sx={setPadding}
5966
/>
6067
))}
6168
</>
@@ -66,6 +73,7 @@ export const CippPropertyListCard = (props) => {
6673
divider={showDivider}
6774
copyItems={copyItems}
6875
key={`${index}-index-PropertyListOffCanvas`}
76+
sx={setPadding}
6977
{...item}
7078
/>
7179
))

src/components/CippComponents/CippPropertyList.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ export const CippPropertyList = (props) => {
1616
const firstHalf = propertyItems.slice(0, half);
1717
const secondHalf = propertyItems.slice(half, propertyItems.length);
1818

19+
const isLabelPresent = (item) => {
20+
return item?.label === "" || item?.label === undefined || item?.label === null;
21+
};
22+
23+
const setPadding = isLabelPresent ? { py: 0.5, px: 3 } : { py: 1.5, px: 3 };
1924
return (
2025
<>
2126
{layout === "single" ? (
@@ -28,6 +33,7 @@ export const CippPropertyList = (props) => {
2833
align={align}
2934
label={item.label}
3035
value={<Skeleton width={280} />}
36+
sx={setPadding}
3137
{...item}
3238
/>
3339
))}
@@ -39,6 +45,7 @@ export const CippPropertyList = (props) => {
3945
divider={showDivider}
4046
copyItems={copyItems}
4147
key={`${index}-index-PropertyListOffCanvas`}
48+
sx={setPadding}
4249
{...item}
4350
/>
4451
))
@@ -69,6 +76,7 @@ export const CippPropertyList = (props) => {
6976
align={align}
7077
label={item.label}
7178
value={<Skeleton width={280} />}
79+
sx={setPadding}
7280
/>
7381
))}
7482
</>
@@ -79,6 +87,7 @@ export const CippPropertyList = (props) => {
7987
divider={showDivider}
8088
copyItems={copyItems}
8189
key={`${index}-index-PropertyListOffCanvas`}
90+
sx={setPadding}
8291
{...item}
8392
/>
8493
))
@@ -93,6 +102,11 @@ export const CippPropertyList = (props) => {
93102
align={align}
94103
label={item.label}
95104
value={<Skeleton width={280} />}
105+
sx={() => {
106+
if (item?.label === "" || item?.label === undefined || item?.label === null) {
107+
return { py: 0 };
108+
}
109+
}}
96110
/>
97111
))}
98112
</>
@@ -103,6 +117,7 @@ export const CippPropertyList = (props) => {
103117
divider={showDivider}
104118
copyItems={copyItems}
105119
key={`${index}-index-PropertyListOffCanvas`}
120+
sx={setPadding}
106121
{...item}
107122
/>
108123
))

src/components/CippComponents/CippTenantSelector.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ export const CippTenantSelector = (props) => {
7777
? {
7878
value: tenant,
7979
label: `${matchingTenant.displayName} (${tenant})`,
80+
addedFields: {
81+
defaultDomainName: matchingTenant.defaultDomainName,
82+
displayName: matchingTenant.displayName,
83+
customerId: matchingTenant.customerId,
84+
},
8085
}
8186
: {
8287
value: null,
@@ -183,7 +188,7 @@ export const CippTenantSelector = (props) => {
183188
actions={[
184189
{
185190
label: "M365 Admin Portal",
186-
link: `https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=${currentTenant?.value}&CSDEST=o365admincenter`,
191+
link: `https://admin.microsoft.com/Partner/BeginClientSession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=o365admincenter`,
187192
icon: <GlobeAltIcon />,
188193
},
189194
{
@@ -213,17 +218,17 @@ export const CippTenantSelector = (props) => {
213218
},
214219
{
215220
label: "Sharepoint Portal",
216-
link: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${currentTenant?.value}&CSDEST=SharePoint`,
221+
link: `https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=${currentTenant?.addedFields?.customerId}&CSDEST=SharePoint`,
217222
icon: <Share />,
218223
},
219224
{
220225
label: "Security Portal",
221-
link: `https://security.microsoft.com/?tid=${currentTenant?.value}`,
226+
link: `https://security.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`,
222227
icon: <Shield />,
223228
},
224229
{
225230
label: "Compliance Portal",
226-
link: `https://compliance.microsoft.com/?tid=${currentTenant?.value}`,
231+
link: `https://compliance.microsoft.com/?tid=${currentTenant?.addedFields?.customerId}`,
227232
icon: <ShieldMoon />,
228233
},
229234
]}

src/components/CippSettings/CippCustomRoles.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const CippCustomRoles = () => {
142142
alltenant = true;
143143
}
144144
});
145-
if (alltenant && (blockedTenants?.length === 0 || !blockedTenants)) {
145+
if (alltenant) {
146146
setAllTenantSelected(true);
147147
} else {
148148
setAllTenantSelected(false);
@@ -299,7 +299,7 @@ export const CippCustomRoles = () => {
299299
name="allowedTenants"
300300
fullWidth={true}
301301
/>
302-
{allTenantSelected && (
302+
{allTenantSelected && blockedTenants?.length == 0 && (
303303
<Alert color="warning">
304304
All tenants selected, no tenant restrictions will be applied unless blocked tenants
305305
are specified.

src/components/property-list-item.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,15 @@ export const PropertyListItem = (props) => {
2121
value = "",
2222
type,
2323
copyItems,
24+
sx = {
25+
px: 3,
26+
py: 1.5,
27+
},
2428
...other
2529
} = props;
2630
const [showPassword, setShowPassword] = useState(false);
2731
return (
28-
<ListItem
29-
component={component}
30-
disableGutters
31-
sx={{
32-
px: 3,
33-
py: 1.5,
34-
}}
35-
{...other}
36-
>
32+
<ListItem component={component} disableGutters sx={sx} {...other}>
3733
<ListItemText
3834
disableTypography
3935
primary={

src/pages/cipp/advanced/timers.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const Page = () => {
2222
"LastOccurrence",
2323
"Status",
2424
"PreferredProcessor",
25+
"ErrorMsg",
2526
];
2627

2728
const offCanvas = {
@@ -72,7 +73,15 @@ const Page = () => {
7273
isFetching={fetchData.isPending}
7374
cardButton={<ResetToDefaultButton />}
7475
offCanvas={offCanvas}
75-
actions={[]}
76+
actions={[
77+
{
78+
label: "Run Now",
79+
type: "POST",
80+
url: apiUrl,
81+
data: { FunctionName: "Command", Parameters: "Parameters" },
82+
confirmText: "Do you want to run this task now?",
83+
},
84+
]}
7685
/>
7786
<CippApiDialog
7887
title="Reset to Default"

src/pages/cipp/settings/backup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const Page = () => {
188188
<Typography variant="body2" sx={{ mt: 3, px: 3 }}>
189189
Backups are stored in the storage account associated with your CIPP instance. You can
190190
download or restore specific points in time from the list below. Enable automatic
191-
updates to have CIPP create daily backups.
191+
backups to have CIPP create daily backups using the scheduler.
192192
</Typography>
193193
{backupList.isSuccess ? (
194194
<Box sx={{ mt: 3 }}>

src/pages/index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,15 @@ const Page = () => {
9696

9797
// Identify which templates apply:
9898
const applicableTemplates = standardsData.filter((template) => {
99-
const tenantInFilter = template?.tenantFilter?.some((tf) => tf.value === currentTenant);
99+
const tenantInFilter =
100+
template?.tenantFilter?.length > 0 &&
101+
template.tenantFilter.some((tf) => tf.value === currentTenant);
100102
const allTenantsTemplate =
101-
template.tenantFilter?.some((tf) => tf.value === "AllTenants") &&
102-
!template.excludedTenants?.some((et) => et.value === currentTenant);
103+
template?.tenantFilter?.length > 0 &&
104+
template.tenantFilter.some((tf) => tf.value === "AllTenants") &&
105+
(!template?.excludedTenants ||
106+
(Array.isArray(template?.excludedTenants) && template?.excludedTenants?.length === 0) ||
107+
!template?.excludedTenants?.some((et) => et.value === currentTenant));
103108
return tenantInFilter || allTenantsTemplate;
104109
});
105110

@@ -242,10 +247,10 @@ const Page = () => {
242247
propertyItems={organization.data?.verifiedDomains
243248
?.slice(0, domainVisible ? undefined : 3)
244249
.map((domain, idx) => ({
245-
label: `Domain`,
250+
label: "",
246251
value: domain.name,
247252
}))}
248-
actions={
253+
actionItems={
249254
organization.data?.verifiedDomains?.length > 3 && (
250255
<Button onClick={() => setDomainVisible(!domainVisible)}>
251256
{domainVisible ? "See less" : "See more..."}

0 commit comments

Comments
 (0)