Skip to content

Commit cc8daf0

Browse files
authored
Merge pull request #2452 from JohnDuprey/dev
Onboarding Standards Exclusion
2 parents a55fc62 + c8bcc83 commit cc8daf0

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

src/components/utilities/CippTableOffcanvas.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function CippTableOffcanvas({
1414
tableProps,
1515
data = null,
1616
}) {
17-
if (Array.isArray(data) && data !== null && data !== undefined) {
17+
if (Array.isArray(data) && data !== null && data !== undefined && data?.length > 0) {
1818
if (!Array.isArray(data) && typeof data === 'object') {
1919
data = Object.keys(data).map((key) => {
2020
return {

src/views/tenant/administration/TenantOnboardingWizard.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ const TenantOnboardingWizard = () => {
183183
<h5 className="card-title mb-4">Tenant Onboarding Options</h5>
184184
</center>
185185
<hr className="my-4" />
186+
<h5>Standards</h5>
187+
<RFFCFormSwitch
188+
name="standardsExcludeAllTenants"
189+
helpText='Enabling this feature excludes this tenant from any top-level
190+
"All Tenants" standard. This means that only the standards you
191+
explicitly set for this tenant will be applied.'
192+
label="Exclude this tenant from top-level standards"
193+
className="mb-4"
194+
/>
186195
<h5>Optional Settings</h5>
187196
<p>
188197
Use these options for relationships created outside of the CIPP Invite Wizard or if the
@@ -257,6 +266,7 @@ const TenantOnboardingWizard = () => {
257266
gdapRoles={props.values.gdapRoles}
258267
autoMapRoles={props.values.autoMapRoles}
259268
addMissingGroups={props.values.addMissingGroups}
269+
standardsExcludeAllTenants={props.values.standardsExcludeAllTenants}
260270
key={idx}
261271
/>
262272
))}

src/views/tenant/administration/onboarding/RelationshipOnboarding.jsx

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ function useInterval(callback, delay, state) {
4040
}, [delay, state])
4141
}
4242

43-
const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMissingGroups }) => {
44-
const [relationshipReady, setRelationshipReady] = useState(false)
45-
const [refreshGuid, setRefreshGuid] = useState(false)
43+
const RelationshipOnboarding = ({
44+
relationship,
45+
gdapRoles,
46+
autoMapRoles,
47+
addMissingGroups,
48+
standardsExcludeAllTenants,
49+
}) => {
4650
const [getOnboardingStatus, onboardingStatus] = useLazyGenericPostRequestQuery()
47-
var headerIcon = relationshipReady ? 'check-circle' : 'question-circle'
4851

4952
useInterval(
5053
async () => {
@@ -58,6 +61,7 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
5861
5000,
5962
onboardingStatus.data,
6063
)
64+
console.log(standardsExcludeAllTenants)
6165

6266
return (
6367
<CAccordionItem>
@@ -125,7 +129,13 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
125129
{onboardingStatus.isUninitialized &&
126130
getOnboardingStatus({
127131
path: '/api/ExecOnboardTenant',
128-
values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups },
132+
values: {
133+
id: relationship.id,
134+
gdapRoles,
135+
autoMapRoles,
136+
addMissingGroups,
137+
standardsExcludeAllTenants,
138+
},
129139
})}
130140
{onboardingStatus.isSuccess && (
131141
<>
@@ -134,7 +144,13 @@ const RelationshipOnboarding = ({ relationship, gdapRoles, autoMapRoles, addMiss
134144
onClick={() =>
135145
getOnboardingStatus({
136146
path: '/api/ExecOnboardTenant?Retry=True',
137-
values: { id: relationship.id, gdapRoles, autoMapRoles, addMissingGroups },
147+
values: {
148+
id: relationship.id,
149+
gdapRoles,
150+
autoMapRoles,
151+
addMissingGroups,
152+
standardsExcludeAllTenants,
153+
},
138154
})
139155
}
140156
className="mb-3 me-2"
@@ -190,6 +206,7 @@ RelationshipOnboarding.propTypes = {
190206
autoMapRoles: PropTypes.bool,
191207
addMissingGroups: PropTypes.bool,
192208
statusOnly: PropTypes.bool,
209+
standardsExcludeAllTenants: PropTypes.bool,
193210
}
194211

195212
export default RelationshipOnboarding

0 commit comments

Comments
 (0)