Skip to content

🐛 Disable reset/save buttons when no flaw changes#784

Open
C-Valen wants to merge 5 commits into
mainfrom
fix/OSIDB-4973-block-saving-flaw-when-no-changes
Open

🐛 Disable reset/save buttons when no flaw changes#784
C-Valen wants to merge 5 commits into
mainfrom
fix/OSIDB-4973-block-saving-flaw-when-no-changes

Conversation

@C-Valen
Copy link
Copy Markdown
Member

@C-Valen C-Valen commented May 18, 2026

OSIDB-4973 Disable reset/save buttons when no flaw changes

Checklist:

  • Commits consolidated
  • Changelog updated
  • Test cases added/updated
  • Integration tests updated

Summary

Prevents users from saving or resetting flaws when no changes have been made, avoiding unnecessary API calls and potential programmatic feedback issues.

Changes

  • Disabled "Save Changes" button when no modifications detected
  • Disabled "Reset Changes" button when no modifications detected
  • Added tooltips explaining why buttons are disabled
  • Detects changes across flaw fields, affects, and CVSS scores

Closes OSIDB-4973

@C-Valen C-Valen self-assigned this May 18, 2026
@C-Valen C-Valen requested a review from a team May 18, 2026 13:56
@C-Valen C-Valen added the bug Something isn't working label May 18, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@C-Valen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 45 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: f1d74f2e-b343-4eed-900b-8e77060dcc0f

📥 Commits

Reviewing files that changed from the base of the PR and between 722b38e and ff2f680.

📒 Files selected for processing (2)
  • src/components/FlawForm/FlawForm.vue
  • src/composables/useFlawModel.ts
📝 Walkthrough

Walkthrough

This PR adds a hasAnyChanges computed property to FlawForm that aggregates flaw, CVSS, affects, and label change signals; in edit mode the "Reset Changes" and "Save Changes" buttons are disabled (and their title updated) when no changes are detected. CHANGELOG.md documents the change (OSIDB-4973).

Changes

Button Disablement Feature

Layer / File(s) Summary
Change tracking computed property
src/components/FlawForm/FlawForm.vue
hasAnyChanges computed property aggregates isFlawUpdated, CVSS modification flags, affects edit/add/remove signals, and areLabelsUpdated to determine whether the form has pending changes.
Button disablement in edit mode
src/components/FlawForm/FlawForm.vue
The "Reset Changes" and "Save Changes" buttons are disabled when hasAnyChanges is false (and while saving); their title attributes are updated accordingly; an inline comment was removed from the flaw watcher.
Changelog documentation
CHANGELOG.md
Adds an Unreleased → Fixed entry noting that "Save Changes" and "Reset Changes" are disabled when no flaw changes exist, referencing OSIDB-4973.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: disabling reset/save buttons when no flaw changes exist, which matches the core functionality in the changeset.
Description check ✅ Passed The PR description follows the repository template with all required sections completed: OSIDB ID included, checklist provided, comprehensive summary and changes listed, with most checklist items marked as complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/OSIDB-4973-block-saving-flaw-when-no-changes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 4: Fix the typo in the changelog entry by replacing the incorrect `"Reset
CHanges"` text with the correctly capitalized `"Reset Changes"` in the
CHANGELOG.md entry that currently reads: * Disable "Save Changes" and "Reset
CHanges" buttons when no flaw changes have been made (`OSIDB-4973`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 89ea890b-3d0d-4064-854c-cfce04b5a9ef

📥 Commits

Reviewing files that changed from the base of the PR and between 4bc2e80 and 032083b.

⛔ Files ignored due to path filters (1)
  • src/components/__tests__/__snapshots__/FlawForm.spec.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/components/FlawForm/FlawForm.vue

Comment thread CHANGELOG.md Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Comment on lines +122 to +127
const hasAnyChanges = computed(() => {
return isFlawUpdated.value
|| wereAffectsEditedOrAdded.value
|| wasFlawCvssModified.value
|| removedAffects.size > 0;
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing labels and jira task creation for legacy flaws

Suggested change
const hasAnyChanges = computed(() => {
return isFlawUpdated.value
|| wereAffectsEditedOrAdded.value
|| wasFlawCvssModified.value
|| removedAffects.size > 0;
});
const hasAnyChanges = computed(() => {
return isFlawUpdated.value
|| wereAffectsEditedOrAdded.value
|| wasFlawCvssModified.value
|| removedAffects.size > 0
|| shouldCreateJiraTask.value
|| areLabelsUpdated.value;
});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, and I agree in the labels approach.

For the Jira task I think is better to handle directly in the button condition, so it is not disabled if the checkbox is marked. The reason is cause the Jira task is not something that changed in the flaw but an async operation to be made on the save action.

Does that makes sense to you?

@C-Valen C-Valen requested a review from MrMarble May 20, 2026 13:23
Co-authored-by: Cursor <cursoragent@cursor.com>
@C-Valen C-Valen force-pushed the fix/OSIDB-4973-block-saving-flaw-when-no-changes branch from 722b38e to ff2f680 Compare May 20, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants