web/admin: fix urls not showing when pre-selected provider is used
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
3af48a81e2
commit
9900cc5c81
|
@ -181,16 +181,8 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
|
|||
<select class="pf-c-form-control" @change=${(ev: Event) => {
|
||||
const el = (ev.target as HTMLSelectElement);
|
||||
const selected = el.selectedOptions[0];
|
||||
if ("data-urls-custom" in selected.attributes) {
|
||||
this.showUrlOptions = true;
|
||||
} else {
|
||||
this.showUrlOptions = false;
|
||||
}
|
||||
if ("data-request-token" in selected.attributes) {
|
||||
this.showRequestTokenURL = true;
|
||||
} else {
|
||||
this.showRequestTokenURL = false;
|
||||
}
|
||||
this.showUrlOptions = "data-urls-custom" in selected.attributes;
|
||||
this.showRequestTokenURL = "data-request-token" in selected.attributes;
|
||||
if (!this.instance) {
|
||||
this.instance = {} as OAuthSource;
|
||||
}
|
||||
|
@ -204,6 +196,8 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
|
|||
if (!this.instance?.pk) {
|
||||
if (modelSlug === typeSlug) {
|
||||
selected = true;
|
||||
this.showUrlOptions = type.urlsCustomizable;
|
||||
this.showRequestTokenURL = type.requestTokenUrl !== null;
|
||||
}
|
||||
}
|
||||
return html`<option
|
||||
|
|
Reference in a new issue