Ok - this time add the new controllers we stripped out of inline and add back the csp
This commit is contained in:
24
app/javascript/controllers/application_form_controller.js
Normal file
24
app/javascript/controllers/application_form_controller.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["appTypeSelect", "oidcFields", "forwardAuthFields"]
|
||||
|
||||
connect() {
|
||||
this.updateFieldVisibility()
|
||||
}
|
||||
|
||||
updateFieldVisibility() {
|
||||
const appType = this.appTypeSelectTarget.value
|
||||
|
||||
if (appType === 'oidc') {
|
||||
this.oidcFieldsTarget.classList.remove('hidden')
|
||||
this.forwardAuthFieldsTarget.classList.add('hidden')
|
||||
} else if (appType === 'forward_auth') {
|
||||
this.oidcFieldsTarget.classList.add('hidden')
|
||||
this.forwardAuthFieldsTarget.classList.remove('hidden')
|
||||
} else {
|
||||
this.oidcFieldsTarget.classList.add('hidden')
|
||||
this.forwardAuthFieldsTarget.classList.add('hidden')
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user