web/admin: fix LDAP Source form not exposing syncParentGroup

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-30 18:09:41 +02:00
parent afad55a357
commit 5f6565ee27
4 changed files with 76 additions and 7 deletions

View File

@ -183,6 +183,10 @@ msgstr "Addition User DN"
msgid "Additional group DN, prepended to the Base DN."
msgstr "Additional group DN, prepended to the Base DN."
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Additional settings"
msgstr "Additional settings"
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Additional user DN, prepended to the Base DN."
msgstr "Additional user DN, prepended to the Base DN."
@ -203,7 +207,6 @@ msgid "Advanced protocol settings"
msgstr "Advanced protocol settings"
#: src/pages/policies/password/PasswordPolicyForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Advanced settings"
msgstr "Advanced settings"
@ -1942,7 +1945,7 @@ msgstr "Go to previous page"
#: src/pages/events/RuleForm.ts
#: src/pages/policies/PolicyBindingForm.ts
#: src/pages/policies/PolicyBindingForm.ts
#: src/pages/providers/ldap/LDAPProviderForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/stages/user_write/UserWriteStageForm.ts
msgid "Group"
msgstr "Group"
@ -2268,6 +2271,10 @@ msgstr "Kubeconfig"
msgid "LDAP (Technical preview)"
msgstr "LDAP (Technical preview)"
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "LDAP Attribute mapping"
msgstr "LDAP Attribute mapping"
#: src/pages/providers/ldap/LDAPProviderForm.ts
msgid "LDAP DN under which bind requests and search requests can be made."
msgstr "LDAP DN under which bind requests and search requests can be made."
@ -2413,6 +2420,7 @@ msgstr "Loading"
#: src/pages/providers/saml/SAMLProviderImportForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts
#: src/pages/sources/plex/PlexSourceForm.ts
@ -3035,6 +3043,10 @@ msgstr "PEM-encoded Certificate data."
msgid "Parent"
msgstr "Parent"
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Parent group for all the groups imported from LDAP."
msgstr "Parent group for all the groups imported from LDAP."
#: src/pages/policies/dummy/DummyPolicyForm.ts
msgid "Pass policy?"
msgstr "Pass policy?"
@ -4342,6 +4354,10 @@ msgstr "Sync"
msgid "Sync groups"
msgstr "Sync groups"
#: src/pages/providers/ldap/LDAPProviderForm.ts
msgid "Sync parent group"
msgstr "Sync parent group"
#: src/pages/sources/ldap/LDAPSourceViewPage.ts
msgid "Sync status"
msgstr "Sync status"

View File

@ -183,6 +183,10 @@ msgstr ""
msgid "Additional group DN, prepended to the Base DN."
msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Additional settings"
msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Additional user DN, prepended to the Base DN."
msgstr ""
@ -203,7 +207,6 @@ msgid "Advanced protocol settings"
msgstr ""
#: src/pages/policies/password/PasswordPolicyForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Advanced settings"
msgstr ""
@ -1934,7 +1937,7 @@ msgstr ""
#: src/pages/events/RuleForm.ts
#: src/pages/policies/PolicyBindingForm.ts
#: src/pages/policies/PolicyBindingForm.ts
#: src/pages/providers/ldap/LDAPProviderForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/stages/user_write/UserWriteStageForm.ts
msgid "Group"
msgstr ""
@ -2260,6 +2263,10 @@ msgstr ""
msgid "LDAP (Technical preview)"
msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "LDAP Attribute mapping"
msgstr ""
#: src/pages/providers/ldap/LDAPProviderForm.ts
msgid "LDAP DN under which bind requests and search requests can be made."
msgstr ""
@ -2405,6 +2412,7 @@ msgstr ""
#: src/pages/providers/saml/SAMLProviderImportForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/ldap/LDAPSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts
#: src/pages/sources/oauth/OAuthSourceForm.ts
#: src/pages/sources/plex/PlexSourceForm.ts
@ -3027,6 +3035,10 @@ msgstr ""
msgid "Parent"
msgstr ""
#: src/pages/sources/ldap/LDAPSourceForm.ts
msgid "Parent group for all the groups imported from LDAP."
msgstr ""
#: src/pages/policies/dummy/DummyPolicyForm.ts
msgid "Pass policy?"
msgstr ""
@ -4334,6 +4346,10 @@ msgstr ""
msgid "Sync groups"
msgstr ""
#: src/pages/providers/ldap/LDAPProviderForm.ts
msgid "Sync parent group"
msgstr ""
#: src/pages/sources/ldap/LDAPSourceViewPage.ts
msgid "Sync status"
msgstr ""

View File

@ -95,7 +95,7 @@ export class LDAPProviderFormPage extends ModelForm<LDAPProvider, number> {
${t`Flow used for users to authenticate. Currently only identification and password stages are supported.`}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`Group`} name="searchGroup">
<ak-form-element-horizontal label=${t`Sync parent group`} name="searchGroup">
<select class="pf-c-form-control">
<option value="" ?selected=${this.instance?.searchGroup === undefined}>
---------

View File

@ -5,7 +5,13 @@ import { customElement } from "lit/decorators";
import { ifDefined } from "lit/directives/if-defined";
import { until } from "lit/directives/until";
import { LDAPSource, SourcesApi, PropertymappingsApi, LDAPSourceRequest } from "@goauthentik/api";
import {
LDAPSource,
SourcesApi,
PropertymappingsApi,
LDAPSourceRequest,
CoreApi,
} from "@goauthentik/api";
import { DEFAULT_CONFIG } from "../../../api/Config";
import "../../../elements/forms/FormGroup";
@ -157,7 +163,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
</div>
</ak-form-group>
<ak-form-group>
<span slot="header"> ${t`Advanced settings`} </span>
<span slot="header"> ${t`LDAP Attribute mapping`} </span>
<div slot="body" class="pf-c-form">
<ak-form-element-horizontal
label=${t`User Property Mappings`}
@ -250,6 +256,37 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
${t`Hold control/command to select multiple items.`}
</p>
</ak-form-element-horizontal>
</div>
</ak-form-group>
<ak-form-group>
<span slot="header"> ${t`Additional settings`} </span>
<div slot="body" class="pf-c-form">
<ak-form-element-horizontal label=${t`Group`} name="syncParentGroup">
<select class="pf-c-form-control">
<option
value=""
?selected=${this.instance?.syncParentGroup === undefined}
>
---------
</option>
${until(
new CoreApi(DEFAULT_CONFIG).coreGroupsList({}).then((groups) => {
return groups.results.map((group) => {
return html`<option
value=${ifDefined(group.pk)}
?selected=${this.instance?.syncParentGroup === group.pk}
>
${group.name}
</option>`;
});
}),
html`<option>${t`Loading...`}</option>`,
)}
</select>
<p class="pf-c-form__helper-text">
${t`Parent group for all the groups imported from LDAP.`}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${t`Addition User DN`}
name="additionalUserDn"