Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIPP-SAM API permissions & misc fixes #2813

Merged
merged 4 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Tools/Start-CippDevEmulators.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
Write-Host "Starting CIPP Dev Emulators"
Write-Host 'Starting CIPP Dev Emulators'
Get-Process node -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue
$Path = (Get-Item $PSScriptRoot).Parent.Parent.FullName
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

$Process = Read-Host -Prompt 'Start Process Function (y/N)?'

if ($Process -eq 'y') {
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
} else {
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 changes: 2 additions & 2 deletions src/components/contentcards/CippButtonCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function CippButtonCard({
titleType = 'normal',
CardButton,
children,
isFetching,
isFetching = false,
className = 'h-100',
}) {
return (
Expand All @@ -32,6 +32,6 @@ CippButtonCard.propTypes = {
titleType: PropTypes.string,
CardButton: PropTypes.element.isRequired,
children: PropTypes.element.isRequired,
isFetching: PropTypes.bool.isRequired,
isFetching: PropTypes.bool,
className: PropTypes.string,
}
6 changes: 5 additions & 1 deletion src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ export const RFFSelectSearch = ({
retainInput = true,
isLoading = false,
allowCreate = false,
onCreateOption,
refreshFunction,
...props
}) => {
Expand Down Expand Up @@ -589,7 +590,7 @@ export const RFFSelectSearch = ({
)}
</CFormLabel>
{allowCreate ? (
<Creatable {...selectProps} isClearable={true} />
<Creatable {...selectProps} isClearable={true} onCreateOption={onCreateOption} />
) : (
<Select {...selectProps} isClearable={!onChange} />
)}
Expand All @@ -612,6 +613,9 @@ RFFSelectSearch.propTypes = {
onInputChange: PropTypes.func,
isLoading: PropTypes.bool,
refreshFunction: PropTypes.func,
allowCreate: PropTypes.bool,
onCreateOption: PropTypes.func,
retainInput: PropTypes.bool,
values: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.string, name: PropTypes.string }))
.isRequired,
}
12 changes: 10 additions & 2 deletions src/components/tables/CellGenericFormat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ function nocolour(iscolourless, content) {
export function CellTip(cell, overflow = false) {
return (
<CTooltip content={String(cell)}>
<div className="celltip-content-nowrap">{String(cell)}</div>
{overflow ? (
<div className="celltip-content">{String(cell)}</div>
) : (
<div className="celltip-content-nowrap">{String(cell)}</div>
)}
</CTooltip>
)
}

export const cellGenericFormatter =
({ warning = false, reverse = false, colourless = true, noDataIsFalse } = {}) =>
({ warning = false, reverse = false, colourless = true, noDataIsFalse, wrap = false } = {}) =>
// eslint-disable-next-line react/display-name
(row, index, column, id) => {
const cell = column.selector(row)
Expand All @@ -51,6 +55,10 @@ export const cellGenericFormatter =
</a>
)
}

if (wrap) {
return CellTip(cell, true)
}
return CellTip(cell)
}
if (typeof cell === 'number') {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tables/CellTip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export const CellTipButton = (value, display) => {
)
}

export const CellTip = (value, overflow = false) => {
export const CellTip = (value, wrap = false) => {
if (!value) {
return <div />
}
if (!overflow) {
if (!wrap) {
return (
<CTooltip content={value}>
<div className="celltip-content-nowrap">{String(value)}</div>
Expand Down
Loading
Loading