Skip to content

Commit e8418ff

Browse files
Merge pull request #2208 from k-grube/dev
Refactor CIPP Settings
2 parents 147f7fe + 5d2f33e commit e8418ff

22 files changed

+2554
-2248
lines changed

package-lock.json

Lines changed: 52 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "4.5.5",
3+
"version": "5.2.1",
44
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
55
"homepage": "https://cipp.app/",
66
"bugs": {
@@ -31,11 +31,11 @@
3131
"@coreui/react": "^4.11.0",
3232
"@coreui/react-chartjs": "^2.1.3",
3333
"@coreui/utils": "^1.3.1",
34-
"@fortawesome/fontawesome-svg-core": "^1.2.36",
35-
"@fortawesome/free-brands-svg-icons": "^5.15.4",
36-
"@fortawesome/free-regular-svg-icons": "^5.15.4",
37-
"@fortawesome/free-solid-svg-icons": "^5.15.4",
38-
"@fortawesome/react-fontawesome": "^0.1.16",
34+
"@fortawesome/fontawesome-svg-core": "^6.5.1",
35+
"@fortawesome/free-brands-svg-icons": "^6.5.1",
36+
"@fortawesome/free-regular-svg-icons": "^6.5.1",
37+
"@fortawesome/free-solid-svg-icons": "^6.5.1",
38+
"@fortawesome/react-fontawesome": "^0.2.0",
3939
"@monaco-editor/react": "^4.5.2",
4040
"@popperjs/core": "^2.10.2",
4141
"@reduxjs/toolkit": "^1.9.7",

src/adminRoutes.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
2-
const CIPPSettings = React.lazy(() => import('src/views/cipp/CIPPSettings'))
2+
3+
const CIPPSettings = React.lazy(() => import('src/views/cipp/app-settings/CIPPSettings'))
34
const Setup = React.lazy(() => import('src/views/cipp/Setup'))
45
const ApplyStandard = React.lazy(() => import('src/views/tenant/standards/ListStandards'))
56
const GDAPStatus = React.lazy(() => import('src/views/tenant/administration/ListGDAPQueue'))
@@ -25,7 +26,11 @@ const adminRoutes = [
2526
{ path: '/cipp/setup', name: 'Setup', component: Setup },
2627

2728
{ path: '/tenant/administration/gdap', name: 'GDAP Wizard', component: GDAP },
28-
{ path: '/tenant/administration/gdap-invite', name: 'GDAP Invite Wizard', component: GDAPInvite },
29+
{
30+
path: '/tenant/administration/gdap-invite',
31+
name: 'GDAP Invite Wizard',
32+
component: GDAPInvite,
33+
},
2934
{
3035
path: '/tenant/administration/gdap-role-wizard',
3136
name: 'GDAP Role Wizard',
@@ -41,9 +46,21 @@ const adminRoutes = [
4146
name: 'GDAP Relationships',
4247
component: GDAPRelationships,
4348
},
44-
{ path: '/tenant/administration/appapproval', name: 'App Approval', component: appapproval },
45-
{ path: '/tenant/administration/gdap-status', name: 'GDAP Status', component: GDAPStatus },
46-
{ path: '/tenant/standards/list-standards', name: 'List Standard', component: ApplyStandard },
49+
{
50+
path: '/tenant/administration/appapproval',
51+
name: 'App Approval',
52+
component: appapproval,
53+
},
54+
{
55+
path: '/tenant/administration/gdap-status',
56+
name: 'GDAP Status',
57+
component: GDAPStatus,
58+
},
59+
{
60+
path: '/tenant/standards/list-standards',
61+
name: 'List Standard',
62+
component: ApplyStandard,
63+
},
4764
{
4865
path: '/tenant/administration/tenant-offboarding-wizard',
4966
name: 'Tenant Offboarding',

src/components/layout/CippCallout.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.cipp-callout {
2+
--cui-callout-padding-x: 1rem;
3+
--cui-callout-padding-y: 1rem;
4+
--cui-callout-border-width: var(--cui-border-width);
5+
--cui-callout-border-color: var(--cui-border-color);
6+
--cui-callout-border-left-width: calc(var(--cui-border-width) * 4);
7+
--cui-callout-border-radius: var(--cui-border-radius);
8+
border: var(--cui-callout-border-width) solid var(--cui-callout-border-color);
9+
border-radius: var(--cui-callout-border-radius);
10+
margin-bottom: 16px;
11+
padding: var(--cui-callout-padding-y) var(--cui-callout-padding-x);
12+
}
13+
14+
html:not([dir=rtl]) .cipp-callout {
15+
border-left-color: var(--cui-callout-border-left-color);
16+
}
17+
18+
html:not([dir=rtl]) .cipp-callout {
19+
border-left-width: var(--cui-callout-border-left-width);
20+
}
21+
22+
html:not([dir=rtl]) .cipp-callout-dismissible .btn {
23+
right: 0;
24+
}
25+
26+
.cipp-callout-dismissible .btn {
27+
cursor: pointer;
28+
}

src/components/layout/CippCallout.jsx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import React, { useState } from 'react'
2+
import { CAlert, CCallout } from '@coreui/react'
3+
import PropTypes from 'prop-types'
4+
import './CippCallout.css'
5+
import classNames from 'classnames'
6+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
7+
import { faXmark } from '@fortawesome/free-solid-svg-icons'
8+
9+
export function CippCallout({
10+
dismissible = false,
11+
color = 'primary',
12+
children = null,
13+
className = '',
14+
style = {},
15+
...rest
16+
}) {
17+
const [open, setOpen] = useState(true)
18+
19+
if (!open) {
20+
return null
21+
}
22+
23+
return (
24+
<div
25+
className={classNames(className, 'cipp-callout', `callout-${color}`, {
26+
'cipp-callout-dismissible': dismissible,
27+
})}
28+
color={color}
29+
style={{
30+
backgroundColor: 'rgb(var(--cui-body-color-rgb))',
31+
color: 'var(--cui-body-color)',
32+
display: 'flex',
33+
justifyContent: 'space-between',
34+
alignItems: 'flex-start',
35+
...style,
36+
}}
37+
{...rest}
38+
>
39+
<div>{children}</div>
40+
{dismissible && (
41+
<button
42+
type="button"
43+
className="btn"
44+
aria-label="Close"
45+
onClick={() => setOpen(false)}
46+
style={{ padding: 0, margin: 0 }}
47+
>
48+
<FontAwesomeIcon icon={faXmark} size={'xl'} />
49+
</button>
50+
)}
51+
</div>
52+
)
53+
}
54+
55+
CippCallout.propTypes = {
56+
dismissible: PropTypes.bool,
57+
color: PropTypes.oneOf([
58+
'primary',
59+
'secondary',
60+
'success',
61+
'warning',
62+
'danger',
63+
'info',
64+
'light',
65+
'dark',
66+
]),
67+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
68+
className: PropTypes.string,
69+
style: PropTypes.object,
70+
}

src/components/layout/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import CippContentCard from 'src/components/layout/CippContentCard'
77
import { CippMasonry, CippMasonryItem } from 'src/components/layout/CippMasonry'
88
import { CippPage, CippPageList } from 'src/components/layout/CippPage'
99
import CippWizard from 'src/components/layout/CippWizard'
10+
import { CippCallout } from 'src/components/layout/CippCallout.jsx'
1011

1112
export {
1213
AppBreadcrumb,
@@ -19,5 +20,6 @@ export {
1920
CippMasonryItem,
2021
CippPage,
2122
CippPageList,
23+
CippCallout,
2224
CippWizard,
2325
}

0 commit comments

Comments
 (0)