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

Enhancements #838

Merged
merged 5 commits into from
Jan 30, 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
8 changes: 7 additions & 1 deletion src/sso/connections/ConnectionList/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export default function ConnectionList(props: ConnectionListProps) {
const [urlPath, qs] = _url.split('?');
const urlParams = new URLSearchParams(qs);
if (props.tenant) {
urlParams.set('tenant', props.tenant);
if (Array.isArray(props.tenant)) {
for (const _tenant of props.tenant) {
urlParams.append('tenant', _tenant);
}
} else {
urlParams.set('tenant', props.tenant);
}
}
if (props.product) {
urlParams.set('product', props.product);
Expand Down
2 changes: 1 addition & 1 deletion src/sso/connections/ConnectionsWrapper/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function ConnectionsWrapper(props: ConnectionsWrapperProp) {
urls={{ get: props.urls.get }}
handleActionClick={state.switchToEditView}
handleListFetchComplete={state.handleListFetchComplete}
tenant={props.defaults?.tenant}
tenant={props.defaults?.tenants || props.defaults?.tenant}
product={props.defaults?.product}></ConnectionList>
</div>
</Show>
Expand Down
14 changes: 14 additions & 0 deletions src/sso/connections/CreateConnection/oidc/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const DEFAULT_VALUES = {
const INITIAL_VALUES = {
oidcConnection: {
name: '',
label: '',
description: '',
tenant: '',
product: '',
Expand Down Expand Up @@ -142,6 +143,19 @@ export default function CreateOIDCConnection(props: CreateConnectionProps) {
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('label')}>
<InputField
label='Connection label (Optional)'
id='label'
classNames={state.classes.inputField}
placeholder=''
required={false}
readOnly={state.isReadOnly('label')}
value={state.oidcConnection.label}
handleInputChange={state.handleChange}
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('description')}>
<InputField
label='Description (Optional)'
Expand Down
14 changes: 14 additions & 0 deletions src/sso/connections/CreateConnection/saml/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const DEFAULT_VALUES = {
const INITIAL_VALUES = {
samlConnection: {
name: '',
label: '',
description: '',
tenant: '',
product: '',
Expand Down Expand Up @@ -126,6 +127,19 @@ export default function CreateSAMLConnection(props: CreateConnectionProps) {
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('label')}>
<InputField
label='Connection label (Optional)'
id='label'
classNames={state.classes.inputField}
placeholder=''
required={false}
readOnly={state.isReadOnly('label')}
value={state.samlConnection.label}
handleInputChange={state.handleChange}
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('description')}>
<InputField
label='Description (Optional)'
Expand Down
12 changes: 12 additions & 0 deletions src/sso/connections/EditConnection/oidc/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,18 @@ export default function EditOIDCConnection(props: EditOIDCConnectionProps) {
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('label')}>
<InputField
label='Connection label (Optional)'
id='label'
classNames={state.classes.inputField}
placeholder=''
required={false}
value={state.oidcConnection.label!}
handleInputChange={state.handleChange}
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('description')}>
<InputField
label='Description (Optional)'
Expand Down
19 changes: 15 additions & 4 deletions src/sso/connections/EditConnection/saml/index.lite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const DEFAULT_VALUES = {
const INITIAL_VALUES = {
samlConnection: {
name: '',
label: '',
tenant: '',
product: '',
clientID: '',
Expand Down Expand Up @@ -169,7 +170,7 @@ export default function EditSAMLConnection(props: EditSAMLConnectionProps) {
defaultRedirectUrl: _connection.defaultRedirectUrl,
rawMetadata: _connection.rawMetadata || '',
metadataUrl: _connection.metadataUrl || '',
forceAuthn: _connection.forceAuthn === true || _connection.forceAuthn === 'true',
forceAuthn: _connection.forceAuthn === true,
};
}
}
Expand Down Expand Up @@ -219,6 +220,18 @@ export default function EditSAMLConnection(props: EditSAMLConnectionProps) {
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('label')}>
<InputField
label='Connection label (Optional)'
id='label'
classNames={state.classes.inputField}
placeholder=''
required={false}
value={state.samlConnection.label!}
handleInputChange={state.handleChange}
/>
<Spacer y={6} />
</Show>
<Show when={!state.isExcluded('description')}>
<InputField
label='Description (Optional)'
Expand Down Expand Up @@ -297,9 +310,7 @@ export default function EditSAMLConnection(props: EditSAMLConnectionProps) {
<Show when={state.formVariant === 'advanced'}>
<Show when={!state.isExcluded('forceAuthn')}>
<Checkbox
checked={
state.samlConnection.forceAuthn === 'true' || state.samlConnection.forceAuthn === true
}
checked={state.samlConnection.forceAuthn === true}
handleChange={state.handleChange}
label='Force Authentication'
name='forceAuthn'
Expand Down
5 changes: 3 additions & 2 deletions src/sso/connections/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ConnectionListProps {
tableContainer?: string;
};
tableProps?: TableProps;
tenant?: string;
tenant?: string | string[];
product?: string;
}

Expand Down Expand Up @@ -111,6 +111,7 @@ interface SSOConnection {
tenant: string;
product: string;
name?: string;
label?: string;
description?: string;
}

Expand Down Expand Up @@ -294,7 +295,7 @@ export interface EditSAMLConnectionProps {

export interface ConnectionsWrapperProp {
title?: string;
defaults?: Partial<SSOConnection & Pick<SAMLSSOConnection, 'forceAuthn'>>;
defaults?: Partial<SSOConnection & Pick<SAMLSSOConnection, 'forceAuthn'> & { tenants: string[] }>;
classNames?: {
button?: { ctoa?: string; destructive?: string };
input?: string;
Expand Down
Loading