Skip to content

Commit f31e643

Browse files
Merge pull request #656 from KelvinTegelaar/dev
Upgrading Dev to Release
2 parents 905323e + 0eb8a02 commit f31e643

File tree

16 files changed

+156
-77
lines changed

16 files changed

+156
-77
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test": "react-scripts test",
2222
"test:cov": "npm test -- --coverage --watchAll=false",
2323
"test:debug": "react-scripts --inspect-brk test --runInBand",
24-
"start-api": "swa start --ssl --ssl-cert ./.vscode/cert.crt --ssl-key ./.vscode/key.key --swa-config-location . http://localhost:3000 --api-location http://localhost:7071 --swa-config-location .vscode",
24+
"start-api": "swa start --ssl --ssl-cert ./.vscode/cert.crt --ssl-key ./.vscode/key.key --swa-config-location .vscode http://localhost:3000 --api-location http://localhost:7071",
2525
"prepare": "husky install"
2626
},
2727
"config": {

src/components/tables/CippTable.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,34 @@ FilterComponent.propTypes = {
2828
onClear: PropTypes.func,
2929
}
3030

31+
const customSort = (rows, selector, direction) => {
32+
return rows.sort((a, b) => {
33+
// use the selector to resolve your field names by passing the sort comparitors
34+
let aField
35+
let bField
36+
if (typeof selector(a) === 'string') {
37+
aField = selector(a).toLowerCase()
38+
} else {
39+
aField = selector(a)
40+
}
41+
if (typeof selector(b) === 'string') {
42+
bField = selector(b).toLowerCase()
43+
} else {
44+
bField = selector(b)
45+
}
46+
47+
let comparison = 0
48+
49+
if (aField > bField) {
50+
comparison = 1
51+
} else if (aField < bField) {
52+
comparison = -1
53+
}
54+
55+
return direction === 'desc' ? comparison * -1 : comparison
56+
})
57+
}
58+
3159
export default function CippTable({
3260
data,
3361
isFetching = false,
@@ -49,6 +77,7 @@ export default function CippTable({
4977
expandableRowsHideExpander,
5078
expandOnRowClicked,
5179
selectableRows,
80+
sortFunction = customSort,
5281
onSelectedRowsChange,
5382
highlightOnHover = true,
5483
disableDefaultActions = false,
@@ -179,6 +208,7 @@ export default function CippTable({
179208
expandOnRowClicked={expandOnRowClicked}
180209
defaultSortAsc
181210
defaultSortFieldId={1}
211+
sortFunction={customSort}
182212
paginationPerPage={25}
183213
progressPending={isFetching}
184214
progressComponent={<CSpinner color="info" component="div" />}

src/scss/_themes.scss

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,10 @@
6767
--cui-dark-rgb: var(--cyberdrain-dark-rgb);
6868
--cui-white-rgb: rgb(255 255 255);
6969
--cui-black-rgb: rgb(0 0 0);
70-
--cui-font-sans-serif:
71-
system-ui,
72-
-apple-system,
73-
'Segoe UI',
74-
roboto,
75-
'Helvetica Neue',
76-
arial,
77-
'Noto Sans',
78-
'Liberation Sans',
79-
sans-serif,
80-
'Apple Color Emoji',
81-
'Segoe UI Emoji',
82-
'Segoe UI Symbol',
83-
'Noto Color Emoji';
84-
--cui-font-monospace:
85-
sfmono-regular,
86-
menlo,
87-
monaco,
88-
consolas,
89-
'Liberation Mono',
90-
'Courier New',
70+
--cui-font-sans-serif: system-ui, -apple-system, 'Segoe UI', roboto, 'Helvetica Neue', arial,
71+
'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
72+
'Segoe UI Symbol', 'Noto Color Emoji';
73+
--cui-font-monospace: sfmono-regular, menlo, monaco, consolas, 'Liberation Mono', 'Courier New',
9174
monospace;
9275
--cui-gradient: linear-gradient(180deg, rgb(255 255 255 / 15%), rgb(255 255 255 / 0%));
9376
--cui-body-font-family: var(--cui-font-sans-serif);
@@ -97,7 +80,7 @@
9780
--cui-card-cap-color: var(--cyberdrain-light);
9881
--cui-card-cap-bg: var(--cyberdrain-accent-blue);
9982
--cui-border-radius: 0;
100-
--cui-badge-color: var(--cyberdrain-dark);
83+
--cui-badge-color: var(--cyberdrain-light);
10184

10285
// CIPP theme-independent variables.
10386
--cipp-border-radius: 0;

src/store/api/app.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ export const appApi = baseApi.injectEndpoints({
2727
Permissions: true,
2828
},
2929
}),
30-
transformResponse: (result) => {
31-
if (!result) {
32-
return []
33-
}
34-
if (!Array.isArray(result.Results)) {
35-
return [result.Results]
36-
}
37-
return result.Results
38-
},
3930
}),
4031
execNotificationConfig: builder.query({
4132
query: ({
@@ -75,17 +66,6 @@ export const appApi = baseApi.injectEndpoints({
7566
},
7667
method: 'post',
7768
}),
78-
transformResponse: (response) => {
79-
if (!response?.Results) {
80-
return []
81-
}
82-
return response?.Results.map((res) =>
83-
res
84-
.replace('<br>', '')
85-
.split(': ')
86-
.reduce((pv, cv) => ({ tenantDomain: pv, result: cv })),
87-
)
88-
},
8969
}),
9070
execClearCache: builder.query({
9171
query: () => ({

src/views/cipp/CIPPSettings.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ export default CIPPSettings
8989
const checkAccessColumns = [
9090
{
9191
name: 'Tenant Domain',
92-
selector: (row) => row['tenantDomain'],
92+
selector: (row) => row['TenantName'],
9393
},
9494
{
9595
name: 'Result',
96-
selector: (row) => row['result'],
96+
selector: (row) => row['Status'],
9797
},
9898
]
9999

@@ -143,7 +143,10 @@ const GeneralSettings = () => {
143143

144144
const handleClearCache = useConfirmModal({
145145
body: <div>Are you sure you want to clear the cache?</div>,
146-
onConfirm: () => clearCache(),
146+
onConfirm: () => {
147+
clearCache()
148+
localStorage.clear()
149+
},
147150
})
148151

149152
const tableProps = {
@@ -171,9 +174,17 @@ const GeneralSettings = () => {
171174
)}
172175
Run Permissions Check
173176
</CButton>
174-
{permissionsResult.status === 'fulfilled' && (
175-
// @todo make this pretty after API is fixed
176-
<div>{permissionsResult.data.map((result) => result)}</div>
177+
{permissionsResult.isSuccess && (
178+
<div>
179+
{permissionsResult.data.Results.MissingPermissions
180+
? 'Your Secure Application Model is missing the following delegated permissions:'
181+
: 'Your Secure Application Model has all required permissions'}
182+
<CListGroup flush>
183+
{permissionsResult.data.Results.MissingPermissions.map((r, index) => (
184+
<CListGroupItem key={index}>{r}</CListGroupItem>
185+
))}
186+
</CListGroup>
187+
</div>
177188
)}
178189
</CCardBody>
179190
</CCard>
@@ -184,8 +195,9 @@ const GeneralSettings = () => {
184195
<CCardTitle>Clear Cache</CCardTitle>
185196
</CCardHeader>
186197
<CCardBody>
187-
Click the button below to clear the tenant cache file, the Best Practice Analyser
188-
cache and the Domain Analyser Cache. <br />
198+
Click the button below to clear the all caches the application uses. This includes the
199+
Best Practice Analyser, Tenant Cache, Domain Analyser, and personal settings such as
200+
theme and usage location <br />
189201
<CButton
190202
onClick={() => handleClearCache()}
191203
disabled={clearCacheResult.isFetching}
@@ -236,7 +248,7 @@ const GeneralSettings = () => {
236248
<CippTable
237249
columns={checkAccessColumns}
238250
tableProps={tableProps}
239-
data={accessCheckResult.data}
251+
data={accessCheckResult.data.Results}
240252
/>
241253
)}
242254
</CCardBody>

src/views/endpoint/defender/ListDefender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const DefenderState = () => {
8585
reportName: `${tenant?.defaultDomainName}-DefenderStatus-List`,
8686
path: '/api/ListDefenderState',
8787
columns,
88-
params: { TenantFilter: tenant?.defaultDomainName },
88+
params: { TenantFilter: tenant?.customerId },
8989
}}
9090
/>
9191
)

src/views/identity/administration/AddUser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ const AddUser = () => {
112112
<CippPage tenantSelector={true} title="Add User">
113113
{postResults.isSuccess && (
114114
<CAlert color="success" dismissible>
115-
{postResults.data?.Results}
115+
{postResults.data?.Results.map((result, index) => (
116+
<li key={index}>{result}</li>
117+
))}
116118
</CAlert>
117119
)}
118120
<CRow>

src/views/identity/administration/User365Management.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ export default function User365Management({ tenantDomain, userId, className }) {
1212
label: 'View in Azure AD',
1313
link: azureADLink,
1414
icon: faUsers,
15+
target: '_blank',
1516
},
1617
{
1718
label: 'View in Endpoint Manager',
1819
link: endpointManagerLink,
1920
icon: faLaptop,
21+
target: '_blank',
2022
},
2123
]
2224
return (

src/views/identity/administration/UserSigninLogs.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,55 +63,68 @@ export default function UserSigninLogs({ userId, tenantDomain, className = null
6363
{
6464
name: 'Date',
6565
selector: (row) => row['Date'],
66+
exportSelector: 'Date',
6667
},
6768
{
6869
name: 'Application',
6970
selector: (row) => row['Application'],
71+
exportSelector: 'Application',
7072
},
7173
{
7274
name: 'Login Status',
7375
selector: (row) => row['LoginStatus'],
76+
exportSelector: 'LoginStatus',
7477
},
7578
{
7679
name: 'Conditional Access Status',
7780
selector: (row) => row['ConditionalAccessStatus'],
81+
exportSelector: 'ConditionalAccessStatus',
7882
},
7983
{
8084
name: 'Overall Login Status',
8185
selector: (row) => row['OverallLoginStatus'],
86+
exportSelector: 'OverallLoginStatus',
8287
},
8388
{
8489
name: 'IP Address',
8590
selector: (row) => row['IPAddress'],
91+
exportSelector: 'IPAddress',
8692
},
8793
{
8894
name: 'Town',
8995
selector: (row) => row['Town'],
96+
exportSelector: 'Town',
9097
},
9198
{
9299
name: 'State',
93100
selector: (row) => row['State'],
101+
exportSelector: 'State',
94102
},
95103
{
96104
name: 'Country',
97105
selector: (row) => row['Country'],
106+
exportSelector: 'Country',
98107
},
99108
{
100109
name: 'Device',
101110
selector: (row) => row['Device'],
111+
exportSelector: 'Device',
102112
},
103113
{
104114
name: 'Device Compliant',
105115
selector: (row) => row['DeviceCompliant'],
106116
cell: cellBooleanFormatter,
117+
exportSelector: 'DeviceCompliant',
107118
},
108119
{
109120
name: 'OS',
110121
selector: (row) => row['OS'],
122+
exportSelector: 'OS',
111123
},
112124
{
113125
name: 'Browser',
114126
selector: (row) => row['Browser'],
127+
exportSelector: 'Browser',
115128
},
116129
{
117130
name: 'Applied CAPs',

src/views/identity/administration/Users.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const Offcanvas = (row, rowIndex, formatExtraData) => {
3838
{ label: 'Given Name', value: `${row.givenName}` },
3939
{ label: 'Surname', value: `${row.surname}` },
4040
{ label: 'Job Title', value: `${row.jobTitle}` },
41+
{ label: 'Licenses', value: `${row.LicJoined}` },
4142
{ label: 'Business Phone', value: `${row.businessPhones}` },
4243
{ label: 'Mobile Phone', value: `${row.mobilePhone}` },
4344
{ label: 'Mail', value: `${row.mail}` },
@@ -122,12 +123,14 @@ const columns = [
122123
selector: (row) => row['displayName'],
123124
sortable: true,
124125
exportSelector: 'displayName',
126+
minWidth: '300px',
125127
},
126128
{
127129
name: 'Email',
128130
selector: (row) => row['mail'],
129131
sortable: true,
130132
exportSelector: 'mail',
133+
minWidth: '350px',
131134
},
132135
{
133136
name: 'User Type',

0 commit comments

Comments
 (0)