fix(settings): make SettingFormModal own its title and label strings #149

Closed
David wants to merge 0 commits from chore/checks-workflow-80f008f1 into main
Owner

The check.yml workflow failed to compile src/pages/settings.rs. The
SettingFormModal props typed title and create_label as &'static str,
but the rsx call sites pass the title through an if/else that the rsx
macro materializes into an owned String, yielding "expected &str, found
String". Every other component in the crate types these props as String,
so this aligns the modal with that convention and lets the call sites pass
both literals and conditionals unchanged.

Also fix an E0597 in use_is_admin: the auth.read() guard was the block's
tail expression, so its temporary outlived the auth binding it borrows.
Binding the guard to a named local drops it before auth, leaving the tail
expression a plain bool.

#MAPPS-171

The check.yml workflow failed to compile src/pages/settings.rs. The SettingFormModal props typed `title` and `create_label` as `&'static str`, but the rsx call sites pass the `title` through an `if/else` that the rsx macro materializes into an owned `String`, yielding "expected `&str`, found `String`". Every other component in the crate types these props as `String`, so this aligns the modal with that convention and lets the call sites pass both literals and conditionals unchanged. Also fix an E0597 in `use_is_admin`: the `auth.read()` guard was the block's tail expression, so its temporary outlived the `auth` binding it borrows. Binding the guard to a named local drops it before `auth`, leaving the tail expression a plain `bool`. #MAPPS-171
fix(settings): make SettingFormModal own its title and label strings
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 50s
Create release / Create release from merged PR (pull_request) Has been skipped
7f063f6ade
The check.yml workflow failed to compile src/pages/settings.rs. The
SettingFormModal props typed `title` and `create_label` as `&'static str`,
but the rsx call sites pass the `title` through an `if/else` that the rsx
macro materializes into an owned `String`, yielding "expected `&str`, found
`String`". Every other component in the crate types these props as `String`,
so this aligns the modal with that convention and lets the call sites pass
both literals and conditionals unchanged.

Also fix an E0597 in `use_is_admin`: the `auth.read()` guard was the block's
tail expression, so its temporary outlived the `auth` binding it borrows.
Binding the guard to a named local drops it before `auth`, leaving the tail
expression a plain `bool`.

#MAPPS-171
nrupard closed this pull request 2026-06-15 15:52:16 +02:00
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 50s
Required
Details
Create release / Create release from merged PR (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!149
No description provided.