-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submit risk scenario update form after creating applied control #1473
Submit risk scenario update form after creating applied control #1473
Conversation
WalkthroughThe changes update form handling and control flows across three files. In the model form component, the synchronous click handler is replaced with an asynchronous one that validates form data before confirming the action while retaining cache deletion. In the risk-scenarios server code, the action now returns additional new control details along with the form state. The corresponding page component has been refactored to integrate a SuperForm mechanism for improved form submission and reactive data updates. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant MF as ModelForm.svelte
participant F as Form Validator
participant P as Parent Component
participant C as Cache Manager
U->>MF: Click Save Button
MF->>F: Call validateForm(data)
alt If valid
F-->>MF: Return valid result
MF->>P: Call onConfirm(event)
else If invalid
F-->>MF: Return invalid result
end
MF->>C: Call deleteCache(model.urlModel)
sequenceDiagram
participant U as User
participant PF as +page.svelte (SuperForm)
participant PS as +page.server.ts
participant M as Modal
U->>PF: Interact with form
PF->>PS: Submit createAppliedControl action
PS-->>PF: Return { form, newControl }
alt New control exists
PF->>PF: Update reactive form store
end
M->>PF: Success response triggers _form.submit()
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (6)
🔇 Additional comments (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0k
Summary by CodeRabbit
New Features
superForm
for improved submission logic and user experience.Bug Fixes