Merge branch 'main' into mobile-app/prepare-webviews
* main: (107 commits) Document the new sign in method Replace handle_ naming Use same constant for fake magic links Replace FakeMagicLink with a temporary object Tidy up session_token Clean up interfaces Split tests by controller or responsibility Simplify auth logic Fix due to unit test when creating with invalid emails Restore sessions_controller test on creating invalid email address Move magic link api tests to their own files Rename test to clarify what they're about Cleanup session creation Update to always return a pending auth token for JSON responses. Update API test for cross code Change test expectation on single tenant mode account creation Add unit tests for the new endpoints Pass a server token when creating a magic link via API Simplify code a bit Simplify session create logic for both html and json ...
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static values = { limit: Number, count: Number }
|
||||
static targets = ["unassigned", "limitMessage"]
|
||||
|
||||
connect() {
|
||||
this.updateState()
|
||||
}
|
||||
|
||||
countValueChanged() {
|
||||
this.updateState()
|
||||
}
|
||||
|
||||
updateState() {
|
||||
const atLimit = this.countValue >= this.limitValue
|
||||
|
||||
this.unassignedTargets.forEach(el => {
|
||||
el.hidden = atLimit
|
||||
})
|
||||
|
||||
if (this.hasLimitMessageTarget) {
|
||||
this.limitMessageTarget.hidden = !atLimit
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user