Skip to content

Commit 51b2170

Browse files
Merge pull request #2837 from KelvinTegelaar/dev
Dev
2 parents 0061bbd + 3042dd4 commit 51b2170

29 files changed

+1671
-317
lines changed

Tools/Start-CippDevEmulators.ps1

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
Write-Host "Starting CIPP Dev Emulators"
1+
Write-Host 'Starting CIPP Dev Emulators'
2+
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
23
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
3-
wt --title CIPP`; new-tab --title 'Azurite' -d $Path pwsh -c azurite`; new-tab --title 'FunctionApp' -d $Path\CIPP-API pwsh -c func start`; new-tab --title 'CIPP Frontend' -d $Path\CIPP pwsh -c npm run start`; new-tab --title 'SWA' -d $Path\CIPP pwsh -c npm run start-swa
4+
5+
$Process = Read-Host -Prompt 'Start Process Function (y/N)?'
6+
7+
if ($Process -eq 'y') {
8+
wt --title CIPP`; new-tab --title 'Azurite' -d $Path pwsh -c azurite`; new-tab --title 'FunctionApp' -d $Path\CIPP-API pwsh -c func start`; new-tab --title 'CIPP Frontend' -d $Path\CIPP pwsh -c npm run start`; new-tab --title 'SWA' -d $Path\CIPP pwsh -c npm run start-swa`; new-tab --title 'CIPP-API-Processor' -d $Path\CIPP-API-Processor pwsh -c func start --port 7072
9+
} else {
10+
wt --title CIPP`; new-tab --title 'Azurite' -d $Path pwsh -c azurite`; new-tab --title 'FunctionApp' -d $Path\CIPP-API pwsh -c func start`; new-tab --title 'CIPP Frontend' -d $Path\CIPP pwsh -c npm run start`; new-tab --title 'SWA' -d $Path\CIPP pwsh -c npm run start-swa
11+
}
412

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "6.2.2",
3+
"version": "6.3.0",
44
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
55
"homepage": "https://cipp.app/",
66
"bugs": {

public/version_latest.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.2.2
1+
6.3.0

src/components/contentcards/CippButtonCard.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function CippButtonCard({
88
titleType = 'normal',
99
CardButton,
1010
children,
11-
isFetching,
11+
isFetching = false,
1212
className = 'h-100',
1313
}) {
1414
return (
@@ -22,16 +22,16 @@ export default function CippButtonCard({
2222
{isFetching && <Skeleton />}
2323
{children}
2424
</CCardBody>
25-
<CCardFooter>{CardButton}</CCardFooter>
25+
{CardButton && <CCardFooter>{CardButton}</CCardFooter>}
2626
</CCard>
2727
)
2828
}
2929

3030
CippButtonCard.propTypes = {
3131
title: PropTypes.string.isRequired,
3232
titleType: PropTypes.string,
33-
CardButton: PropTypes.element.isRequired,
33+
CardButton: PropTypes.element,
3434
children: PropTypes.element.isRequired,
35-
isFetching: PropTypes.bool.isRequired,
35+
isFetching: PropTypes.bool,
3636
className: PropTypes.string,
3737
}

src/components/forms/RFFComponents.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ export const RFFSelectSearch = ({
516516
retainInput = true,
517517
isLoading = false,
518518
allowCreate = false,
519+
onCreateOption,
519520
refreshFunction,
520521
...props
521522
}) => {
@@ -589,7 +590,7 @@ export const RFFSelectSearch = ({
589590
)}
590591
</CFormLabel>
591592
{allowCreate ? (
592-
<Creatable {...selectProps} isClearable={true} />
593+
<Creatable {...selectProps} isClearable={true} onCreateOption={onCreateOption} />
593594
) : (
594595
<Select {...selectProps} isClearable={!onChange} />
595596
)}
@@ -612,6 +613,9 @@ RFFSelectSearch.propTypes = {
612613
onInputChange: PropTypes.func,
613614
isLoading: PropTypes.bool,
614615
refreshFunction: PropTypes.func,
616+
allowCreate: PropTypes.bool,
617+
onCreateOption: PropTypes.func,
618+
retainInput: PropTypes.bool,
615619
values: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.string, name: PropTypes.string }))
616620
.isRequired,
617621
}

src/components/tables/CellGenericFormat.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ function nocolour(iscolourless, content) {
2424
export function CellTip(cell, overflow = false) {
2525
return (
2626
<CTooltip content={String(cell)}>
27-
<div className="celltip-content-nowrap">{String(cell)}</div>
27+
{overflow ? (
28+
<div className="celltip-content">{String(cell)}</div>
29+
) : (
30+
<div className="celltip-content-nowrap">{String(cell)}</div>
31+
)}
2832
</CTooltip>
2933
)
3034
}
3135

3236
export const cellGenericFormatter =
33-
({ warning = false, reverse = false, colourless = true, noDataIsFalse } = {}) =>
37+
({ warning = false, reverse = false, colourless = true, noDataIsFalse, wrap = false } = {}) =>
3438
// eslint-disable-next-line react/display-name
3539
(row, index, column, id) => {
3640
const cell = column.selector(row)
@@ -51,6 +55,10 @@ export const cellGenericFormatter =
5155
</a>
5256
)
5357
}
58+
59+
if (wrap) {
60+
return CellTip(cell, true)
61+
}
5462
return CellTip(cell)
5563
}
5664
if (typeof cell === 'number') {

src/components/tables/CellTable.jsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ export default function cellTable(
2323
if (columnProp === undefined || columnProp === null) {
2424
columnProp = []
2525
} else {
26+
var objectLength = 1
27+
var lengthText = 'Item'
28+
if (columnProp instanceof Array) {
29+
objectLength = columnProp.length
30+
if (objectLength > 1) {
31+
lengthText = 'Items'
32+
}
33+
}
34+
2635
if (!Array.isArray(columnProp) && typeof columnProp === 'object') {
2736
columnProp = Object.keys(columnProp).map((key) => {
2837
return {
@@ -93,7 +102,7 @@ export default function cellTable(
93102
size="sm"
94103
onClick={() => handleTable({ columnProp })}
95104
>
96-
{columnProp.length} Items
105+
{objectLength} {lengthText}
97106
</CButton>
98107
)
99108
}

src/components/tables/CellTip.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export const CellTipButton = (value, display) => {
2323
)
2424
}
2525

26-
export const CellTip = (value, overflow = false) => {
26+
export const CellTip = (value, wrap = false) => {
2727
if (!value) {
2828
return <div />
2929
}
30-
if (!overflow) {
30+
if (!wrap) {
3131
return (
3232
<CTooltip content={value}>
3333
<div className="celltip-content-nowrap">{String(value)}</div>

src/components/tables/CippTable.jsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const FilterComponent = ({ filterText, onFilter, onClear, filterlist, onFilterPr
6363
{filterlist &&
6464
filterlist.map((item, idx) => {
6565
return (
66-
<CDropdownItem key={idx} onClick={() => onFilterPreset(item.filter)}>
66+
<CDropdownItem key={`filter-${idx}`} onClick={() => onFilterPreset(item.filter)}>
6767
{item.filterName}
6868
</CDropdownItem>
6969
)
@@ -722,7 +722,7 @@ export default function CippTable({
722722
{dataKeys() &&
723723
dataKeys().map((item, idx) => {
724724
return (
725-
<CDropdownItem key={idx} onClick={() => addColumn(item)}>
725+
<CDropdownItem key={`select-${idx}`} onClick={() => addColumn(item)}>
726726
{updatedColumns.find(
727727
(o) => o.exportSelector === item && o?.omit !== true,
728728
) && <FontAwesomeIcon icon={faCheck} />}{' '}
@@ -820,7 +820,7 @@ export default function CippTable({
820820
<CDropdownMenu>
821821
{actionsList.map((item, idx) => {
822822
return (
823-
<CDropdownItem key={idx} onClick={() => executeselectedAction(item)}>
823+
<CDropdownItem key={`actions-${idx}`} onClick={() => executeselectedAction(item)}>
824824
{item.label}
825825
</CDropdownItem>
826826
)
@@ -885,6 +885,7 @@ export default function CippTable({
885885
updatedColumns,
886886
addColumn,
887887
setGraphFilter,
888+
isFetching,
888889
])
889890
const tablePageSize = useSelector((state) => state.app.tablePageSize)
890891
const [codeCopied, setCodeCopied] = useState(false)
@@ -950,8 +951,8 @@ export default function CippTable({
950951
const results = message.data?.Results
951952
const displayResults = Array.isArray(results) ? results.join(', ') : results
952953
return (
953-
<>
954-
<li key={`message-${idx}`}>
954+
<React.Fragment key={`message-${idx}`}>
955+
<li>
955956
{displayResults}
956957
<CopyToClipboard text={displayResults} onCopy={() => onCodeCopied()}>
957958
<CButton
@@ -968,7 +969,7 @@ export default function CippTable({
968969
</CButton>
969970
</CopyToClipboard>
970971
</li>
971-
</>
972+
</React.Fragment>
972973
)
973974
})}
974975
{loopRunning && (
@@ -1008,11 +1009,12 @@ export default function CippTable({
10081009
progressPending={isFetching}
10091010
progressComponent={<CSpinner color="info" component="div" />}
10101011
paginationRowsPerPageOptions={[25, 50, 100, 200, 500]}
1012+
keyField={keyField}
10111013
{...rest}
10121014
/>
10131015
{selectedRows.length >= 1 && <CCallout>Selected {selectedRows.length} items</CCallout>}
10141016
<CippCodeOffCanvas
1015-
row={data}
1017+
row={data ?? {}}
10161018
hideButton={true}
10171019
state={codeOffcanvasVisible}
10181020
hideFunction={() => setCodeOffcanvasVisible(false)}

src/components/utilities/CippActionsOffcanvas.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ import { faGlobe } from '@fortawesome/free-solid-svg-icons'
3838
import { cellGenericFormatter } from '../tables/CellGenericFormat'
3939
import ReactSelect from 'react-select'
4040

41-
const CippOffcanvasCard = ({ action, key }) => {
41+
const CippOffcanvasCard = ({ action }) => {
4242
const [offcanvasVisible, setOffcanvasVisible] = useState(false)
4343
return (
4444
<>
45-
<CCard key={key} className="border-top-dark border-top-3 mb-3">
45+
<CCard className="border-top-dark border-top-3 mb-3">
4646
<CCardHeader className="d-flex justify-content-between align-items-center">
4747
<CCardTitle>Report Name: {action.label}</CCardTitle>
4848
</CCardHeader>
@@ -95,7 +95,6 @@ const CippOffcanvasCard = ({ action, key }) => {
9595
}
9696
CippOffcanvasCard.propTypes = {
9797
action: PropTypes.object,
98-
key: PropTypes.object,
9998
}
10099

101100
export default function CippActionsOffcanvas(props) {

0 commit comments

Comments
 (0)