Skip to content
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

Fix #523: Global calendar: display the "My profile" filter only when … #529

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
------------------------
- Fix #525: Fix Space calendar header
- Enh #526: New event from the global calendar: display "Select space..." or "Select calendar..." prompt instead of first Space
- Enh: Show the "Filter by types" filter only if a list a type is available
- Enh #528: Show the "Filter by types" filter only if a list a type is available
- Fix #523: Global calendar: display the "My profile" filter only when the module is enabled in for the User account

1.7.1 (January 17, 2025)
------------------------
Expand Down
27 changes: 10 additions & 17 deletions tests/codeception/acceptance/GlobalCalendarCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ public function testGlobalCalendarCreateEntry(AcceptanceTester $I)
$I->see('Select calendars');
$I->waitForText('Space Event', null, '#calendar');

// Active space and profile filter
$I->click('.calendar_my_spaces');
$I->click('.calendar_my_profile');

$I->wait(2);

$I->waitForText('Space Event', null, '#calendar');

$I->wantToTest('the global calendar filters');
$I->amGoingTo('deselect the space clalendar filter');
$I->click('.calendar_my_spaces');
$I->wait(2);
$I->cantSee('Space Event', '#calendar');

$I->amGoingTo('activate the profile calendar module by creating a new event');
$I->click('.fc-today');
$I->expectTo('see the choose calendar modal');
Expand All @@ -75,12 +61,19 @@ public function testGlobalCalendarCreateEntry(AcceptanceTester $I)

//$I->wait(1);
$I->waitForText('My Test Profile Entry', null, '.fc-event-container');
$I->see('My Test Profile Entry', '.fc-title');

$I->waitForElementVisible('.calendar_my_spaces');
// Active space filter
$I->amGoingTo('Select the space calendar filter');
$I->click('.calendar_my_spaces');
$I->wait(2);
$I->waitForText('Space Event', null, '#calendar');

$I->waitForText('Space Event');
$I->see('My Test Profile Entry', '.fc-title');
$I->wantToTest('the global calendar filters');
$I->amGoingTo('deselect the space calendar filter');
$I->click('.calendar_my_spaces');
$I->wait(2);
$I->waitForText('Space Event', null, '#calendar');
}

/**
Expand Down
18 changes: 10 additions & 8 deletions widgets/views/calendarFilterBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@
<?= Yii::t('CalendarModule.views', 'Select calendars') ?>
</div>
<div style="display:inline-block; float:left;margin-right:10px;">
<div class="checkbox">
<label class="calendar_my_profile">
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views', 'My profile'); ?>
</label>
</div>
<?php if (Yii::$app->user->identity->moduleManager->isEnabled('calendar')): ?>
<div class="checkbox">
<label class="calendar_my_profile">
<input type="checkbox" name="selector" class="selectorCheckbox"
value="<?= ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE; ?>"
<?php if (in_array(ActiveQueryContent::USER_RELATED_SCOPE_OWN_PROFILE, $selectors)): ?>checked="checked"<?php endif; ?>>
<?= Yii::t('CalendarModule.views', 'My profile'); ?>
</label>
</div>
<?php endif; ?>
<div class="checkbox">
<label class="calendar_my_spaces">
<input type="checkbox" name="selector" class="selectorCheckbox"
Expand Down
Loading