Skip to content

Commit

Permalink
Onboarding Standards Exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed May 15, 2024
1 parent a55fc62 commit c8bcc83
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/utilities/CippTableOffcanvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function CippTableOffcanvas({
tableProps,
data = null,
}) {
if (Array.isArray(data) && data !== null && data !== undefined) {
if (Array.isArray(data) && data !== null && data !== undefined && data?.length > 0) {
if (!Array.isArray(data) && typeof data === 'object') {
data = Object.keys(data).map((key) => {
return {
Expand Down
10 changes: 10 additions & 0 deletions src/views/tenant/administration/TenantOnboardingWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ const TenantOnboardingWizard = () => {
<h5 className="card-title mb-4">Tenant Onboarding Options</h5>
</center>
<hr className="my-4" />
<h5>Standards</h5>
<RFFCFormSwitch
name="standardsExcludeAllTenants"
helpText='Enabling this feature excludes this tenant from any top-level
"All Tenants" standard. This means that only the standards you
explicitly set for this tenant will be applied.'
label="Exclude this tenant from top-level standards"
className="mb-4"
/>
<h5>Optional Settings</h5>
<p>
Use these options for relationships created outside of the CIPP Invite Wizard or if the
Expand Down Expand Up @@ -257,6 +266,7 @@ const TenantOnboardingWizard = () => {
gdapRoles={props.values.gdapRoles}
autoMapRoles={props.values.autoMapRoles}
addMissingGroups={props.values.addMissingGroups}
standardsExcludeAllTenants={props.values.standardsExcludeAllTenants}
key={idx}
/>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ function useInterval(callback, delay, state) {
}, [delay, state])
}

const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMissingGroups }) => {
const [relationshipReady, setRelationshipReady] = useState(false)
const [refreshGuid, setRefreshGuid] = useState(false)
const RelationshipOnboarding = ({
relationship,
gdapRoles,
autoMapRoles,
addMissingGroups,
standardsExcludeAllTenants,
}) => {
const [getOnboardingStatus, onboardingStatus] = useLazyGenericPostRequestQuery()
var headerIcon = relationshipReady ? 'check-circle' : 'question-circle'

useInterval(
async () => {
Expand All @@ -58,6 +61,7 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
5000,
onboardingStatus.data,
)
console.log(standardsExcludeAllTenants)

return (
<CAccordionItem>
Expand Down Expand Up @@ -125,7 +129,13 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
{onboardingStatus.isUninitialized &&
getOnboardingStatus({
path: '/api/ExecOnboardTenant',
values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups },
values: {
id: relationship.id,
gdapRoles,
autoMapRoles,
addMissingGroups,
standardsExcludeAllTenants,
},
})}
{onboardingStatus.isSuccess && (
<>
Expand All @@ -134,7 +144,13 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
onClick={() =>
getOnboardingStatus({
path: '/api/ExecOnboardTenant?Retry=True',
values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups },
values: {
id: relationship.id,
gdapRoles,
autoMapRoles,
addMissingGroups,
standardsExcludeAllTenants,
},
})
}
className="mb-3 me-2"
Expand Down Expand Up @@ -190,6 +206,7 @@ RelationshipOnboarding.propTypes = {
autoMapRoles: PropTypes.bool,
addMissingGroups: PropTypes.bool,
statusOnly: PropTypes.bool,
standardsExcludeAllTenants: PropTypes.bool,
}

export default RelationshipOnboarding

0 comments on commit c8bcc83

Please sign in to comment.