Skip to content

Commit

Permalink
refactor: Update Campaign Table
Browse files Browse the repository at this point in the history
Update Milestone Progress Bar in Campaign Tables Dashboard Section
  • Loading branch information
AlexanderBlanchardAC committed Nov 11, 2024
1 parent c1550f9 commit 8172b95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<div>
{translate text="Incomplete" isAdminFacing=true}<br>
<div class="progress" style="width:100%; border:1px solid black; border-radius:4px;height:20px;">
<div class="progress-bar" role="progressbar" aria-valuenow="{$milestone->progress}" aria-valuemin="0"
aria-valuemax="100" style="width: {$milestone->progress}%; line-height: 20px; text-align: center; color: #fff;">
<div class="progress-bar" role="progressbar" aria-valuenow="{$userCampaigns[$campaign->id][$user->id]['milestones'][$milestone->id]['percentageProgress']}" aria-valuemin="0"
aria-valuemax="100" style="width: {$userCampaigns[$campaign->id][$user->id]['milestones'][$milestone->id]['percentageProgress']}%; line-height: 20px; text-align: center; color: #fff;background-color:blue;">
{$userCampaigns[$campaign->id][$user->id]['milestones'][$milestone->id]['percentageProgress']}%
</div>
</div>
Expand All @@ -48,7 +48,7 @@
</td>
{/foreach}
<td>
{if $userCampaigns[$camapign->id][$user->id]['isCampaignComplete']}
{if $userCampaigns[$campaign->id][$user->id]['isCampaignComplete']}
{translate text="Campaign Complete" isAdminFacing=true}
{else}
{translate text="Campaign Incomplete" isAdminFacing=true}
Expand Down
2 changes: 1 addition & 1 deletion code/web/services/Community/CampaignTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function launch() {
'isCampaignComplete' =>$isCampaignComplete,
'milestones' => []
];

var_dump($isCampaignComplete);
//Get milestone completion status
$milestoneCompletionStatus = $userCampaign->checkMilestoneCompletionStatus();

Expand Down
2 changes: 1 addition & 1 deletion code/web/services/Community/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function launch() {
$milestoneCompletionStatus = $userCampaign->checkMilestoneCompletionStatus();
foreach ($milestones as $milestone) {
$milestoneComplete = $milestoneCompletionStatus[$milestone->id] ?? false;
$userProgress = CampaignMilestoneUsersProgress::getProgressByMilestoneId($milestone->id, $campaignId, $user->id);
$userProgress = CampaignMilestoneUsersProgress::getProgressByMilestoneId($milestone->id, $campaign->id, $user->id);
$totalGoals = CampaignMilestone::getMilestoneGoalCountByCampaign($campaign->id, $milestone->id);
$milestoneRewardGiven = CampaignMilestoneUsersProgress::getRewardGivenForMilestone($milestone->id, $user->id);
$userCampaigns[$campaign->id][$user->id]['milestones'][$milestone->id] = [
Expand Down

0 comments on commit 8172b95

Please sign in to comment.