-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Alert popup when a round is already active/paused #303
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds an alert popup to prevent users from starting a new round when another round is already active or paused in a campaign, enforcing the business rule that only one round can be active at a time.
- Implemented conditional logic to check for existing active/paused rounds before allowing new round creation
- Added a dialog component to display a user-friendly warning message
- Modified the "Add Round" button behavior to trigger the alert when appropriate
Comments suppressed due to low confidence (1)
frontend/src/components/Campaign/ViewCampaign.vue:193
- The variable name
ActiveGoalAlert
uses PascalCase which is inconsistent with other ref variables in the component that use camelCase (e.g.,campaignEditMode
,showAddRoundForm
). Consider renaming toactiveGoalAlert
.
const ActiveGoalAlert = ref(false)
@@ -35,7 +35,7 @@ | |||
<cdx-button | |||
v-if="!showAddRoundForm" | |||
action="progressive" | |||
@click="addRound" | |||
@click="campaignRounds.some(r => r.status == 'active' || r.status=='paused') ? (ActiveGoalAlert = true) : addRound()" |
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.
The inline conditional logic in the click handler is complex and hard to read. Consider extracting this logic into a separate method like handleAddRoundClick()
for better maintainability.
Copilot uses AI. Check for mistakes.
</template> | ||
|
||
<script setup> | ||
import { ref, onMounted } from 'vue' | ||
import { ref, onMounted, defineComponent } from 'vue' |
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.
The defineComponent
import is added but not used anywhere in the code. This unused import should be removed.
import { ref, onMounted, defineComponent } from 'vue' | |
import { ref, onMounted } from 'vue' |
Copilot uses AI. Check for mistakes.
label: 'Okay', | ||
actionType: 'progressive' |
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.
The primaryAction
object uses inconsistent indentation (tabs instead of spaces) compared to the rest of the file. Ensure consistent formatting throughout the component.
label: 'Okay', | |
actionType: 'progressive' | |
label: 'Okay', | |
actionType: 'progressive' |
Copilot uses AI. Check for mistakes.
Description