Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AadarshM07
Copy link

Description

  • Implemented an alert popup that notifies the user when a round is already active or paused, indicating that only one round can be maintained at a time

@Jayprakash-SE Jayprakash-SE requested a review from Copilot August 5, 2025 07:15
Copy link

@Copilot Copilot AI left a 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 to activeGoalAlert.
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()"
Copy link
Preview

Copilot AI Aug 5, 2025

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'
Copy link
Preview

Copilot AI Aug 5, 2025

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.

Suggested change
import { ref, onMounted, defineComponent } from 'vue'
import { ref, onMounted } from 'vue'

Copilot uses AI. Check for mistakes.

Comment on lines +216 to +217
label: 'Okay',
actionType: 'progressive'
Copy link
Preview

Copilot AI Aug 5, 2025

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.

Suggested change
label: 'Okay',
actionType: 'progressive'
label: 'Okay',
actionType: 'progressive'

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant