feat(corp/rih): activate submit button when data is complete

The completion detection is very naive for now, but baby steps etc.

Change-Id: Iec6eae77fca13f3fc0ee1225268eef04277b504a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8702
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Vincent Ambo 2023-06-02 17:03:31 +03:00 committed by tazjin
parent 138f1ca1b9
commit 20a6710365
2 changed files with 14 additions and 1 deletions

View file

@ -171,7 +171,10 @@ html! {
<div id="captcha-container" class="smart-captcha mb-3" style="height: 100px" /> <div id="captcha-container" class="smart-captcha mb-3" style="height: 100px" />
<button type="submit" class="btn btn-primary" disabled=true>{"Submit"}</button> <button type="submit" class="btn btn-primary"
disabled={!(self.record.is_complete() && self.captcha_token.is_some())}>
{"Submit"}
</button>
<p class="pt-2"><i>{"This page is still under construction! Please reach out at contact@ if you have any questions."}</i></p> <p class="pt-2"><i>{"This page is still under construction! Please reach out at contact@ if you have any questions."}</i></p>
</form> </form>
</div> </div>

View file

@ -98,6 +98,16 @@ struct Record {
work_background: String, work_background: String,
} }
impl Record {
fn is_complete(&self) -> bool {
!self.name.is_empty()
&& !self.email.is_empty()
&& !self.citizenship.is_empty()
&& !self.position.is_empty()
&& !self.technologies.is_empty()
}
}
struct App { struct App {
// The record being populated. // The record being populated.
record: Record, record: Record,