Skip to content

Commit

Permalink
Merge pull request #192 from humhub/fix/190-public-folders-in-private…
Browse files Browse the repository at this point in the history
…-spaces

Fix folder visibility in private space
  • Loading branch information
luke- authored Sep 4, 2023
2 parents 7742f2d + 80be741 commit ee679da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Changelog
- Fix #184: Display only published content files in the folder "Files from the stream"
- Fix #186: Rename conflicted not published folder/file on creating/uploading
- Fix #189: Initialize module content class
- Fix #190: Fix folder visibility in private space
- Fix #191: Avoid UnknownPropertyException in validation error response

0.16.1 - May 1, 2023
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function createFolder($title = 'test', $description = 'test description',
$this->fillField('Folder[description]', $description);

if($isPublic) {
$this->click('[for="folder-visibility"]');
$this->jsClick('input#folder-visibility');
}

$this->click('Save', '#globalModal');
Expand Down
4 changes: 2 additions & 2 deletions tests/codeception/acceptance/VisibilityCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testVisibility(AcceptanceTester $I)
$I->fillField('Folder[description]', 'visibility2');

$I->expect('The folder visibility to be private');
$I->waitForElement('[for="folder-visibility"] input[type=checkbox]:disabled');
$I->waitForElement('input#folder-visibility:disabled');

$I->click('Save', '#globalModal');
$I->waitForText('This folder is empty.');
Expand All @@ -55,7 +55,7 @@ public function testVisibility(AcceptanceTester $I)
$I->amGoingTo('set the folder visibility to public');
$I->clickFolderContext(3, 'Edit');
$I->waitForText('Edit folder', null, '#globalModal');
$I->click('[for="folder-visibility"]');
$I->jsClick('input#folder-visibility');
$I->click('Save', '#globalModal');
$I->waitForText('visibility2', null, '#fileList');

Expand Down
7 changes: 4 additions & 3 deletions views/edit/modal_edit_folder.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use humhub\modules\ui\form\widgets\ContentHiddenCheckbox;
use humhub\modules\ui\form\widgets\ContentVisibilitySelect;
use humhub\widgets\ModalButton;
use humhub\widgets\ModalDialog;
use yii\bootstrap\ActiveForm;
Expand All @@ -24,8 +25,8 @@
<br />
<?= $form->field($folder, 'title'); ?>
<?= $form->field($folder, 'description'); ?>
<?= $form->field($folder, 'visibility')->checkbox(['disabled' => !$folder->isRoot() && $folder->parentFolder->content->isPrivate()]) ?>
<?= $form->field($folder, 'hidden')->widget(ContentHiddenCheckbox::class, []); ?>
<?= $form->field($folder, 'visibility')->widget(ContentVisibilitySelect::class, ['readonly' => !$folder->isRoot() && $folder->parentFolder->content->isPrivate()]) ?>
<?= $form->field($folder, 'hidden')->widget(ContentHiddenCheckbox::class) ?>
</div>

<div class="modal-footer">
Expand All @@ -34,4 +35,4 @@
</div>
<?php ActiveForm::end() ?>

<?php ModalDialog::end() ?>
<?php ModalDialog::end() ?>

0 comments on commit ee679da

Please sign in to comment.