From b306a1714c5f49f70c2e944ce4b86e8e637ade90 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Tue, 13 Jun 2023 14:31:01 +0200 Subject: [PATCH] Use icon `fa-unlock` for public files --- docs/CHANGELOG.md | 4 ++++ models/rows/BaseFileRow.php | 4 ++-- models/rows/FileSystemItemRow.php | 4 ++-- module.json | 2 +- tests/codeception/acceptance/VisibilityCest.php | 10 +++++----- widgets/views/breadcrumbBar.php | 4 ++-- widgets/views/fileSelectionMenu.php | 4 ++-- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f3aedec..3c0a206 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +0.16.2 - Unreleased +-------------------- +- Fix #180: Use icon `fa-unlock` for public files + 0.16.1 - May 1, 2023 -------------------- - Fix #177: Hard delete records on disable module diff --git a/models/rows/BaseFileRow.php b/models/rows/BaseFileRow.php index 5c66d26..d64d519 100644 --- a/models/rows/BaseFileRow.php +++ b/models/rows/BaseFileRow.php @@ -231,7 +231,7 @@ public function getModel() */ public function getVisibilityIcon() { - return $this->getModel()->content->isPublic() ? 'fa-unlock-alt': 'fa-lock'; + return $this->getModel()->content->isPublic() ? 'fa-unlock': 'fa-lock'; } /** @@ -260,4 +260,4 @@ public function canEdit() // We do not allow base files to be deleted in the cfiles module return false; } -} \ No newline at end of file +} diff --git a/models/rows/FileSystemItemRow.php b/models/rows/FileSystemItemRow.php index 8b9b9ff..929fbfb 100644 --- a/models/rows/FileSystemItemRow.php +++ b/models/rows/FileSystemItemRow.php @@ -204,7 +204,7 @@ public function getDownloadCount() */ public function getVisibilityIcon() { - return $this->item->content->isPublic() ? 'fa-unlock-alt': 'fa-lock'; + return $this->item->content->isPublic() ? 'fa-unlock': 'fa-lock'; } /** @@ -219,4 +219,4 @@ public function getVisibilityTitle() * @return WallStreamModuleEntryWidget */ abstract public function getContext(): WallStreamModuleEntryWidget; -} \ No newline at end of file +} diff --git a/module.json b/module.json index fbf712a..d22aeaf 100644 --- a/module.json +++ b/module.json @@ -9,7 +9,7 @@ "organisation", "sharing" ], - "version": "0.16.1", + "version": "0.16.2", "humhub": { "minVersion": "1.14" }, diff --git a/tests/codeception/acceptance/VisibilityCest.php b/tests/codeception/acceptance/VisibilityCest.php index 1b66dee..78a2768 100644 --- a/tests/codeception/acceptance/VisibilityCest.php +++ b/tests/codeception/acceptance/VisibilityCest.php @@ -60,13 +60,13 @@ public function testVisibility(AcceptanceTester $I) $I->waitForText('visibility2', null, '#fileList'); $I->expect('all subfiles and subfolders to be public too'); - $I->seeElement('.folder-visibility .fa-unlock-alt'); - $I->seeElement('[data-cfiles-item="folder_4"] .fa-unlock-alt'); - $I->seeElement('[data-cfiles-item="file_1"] .fa-unlock-alt'); + $I->seeElement('.folder-visibility .fa-unlock'); + $I->seeElement('[data-cfiles-item="folder_4"] .fa-unlock'); + $I->seeElement('[data-cfiles-item="file_1"] .fa-unlock'); $I->click('visibility2', '#fileList'); $I->waitForText('visibility2', null,'#cfiles-crumb'); - $I->seeElement('[data-cfiles-item="file_2"] .fa-unlock-alt'); + $I->seeElement('[data-cfiles-item="file_2"] .fa-unlock'); $I->amGoingTo('Reset the file visibility of /visibility/visibility2/test.txt to private'); $I->clickFileContext(2, 'Edit'); @@ -88,4 +88,4 @@ public function testVisibility(AcceptanceTester $I) $I->waitForText('visibility2',null,'#cfiles-crumb'); $I->dontSee('test.txt', '#fileList'); } -} \ No newline at end of file +} diff --git a/widgets/views/breadcrumbBar.php b/widgets/views/breadcrumbBar.php index 8590189..0a854a0 100644 --- a/widgets/views/breadcrumbBar.php +++ b/widgets/views/breadcrumbBar.php @@ -5,14 +5,14 @@ /* @var $folder \humhub\modules\cfiles\models\Folder */ if($folder->content->isPublic()) { - $visibilityIcon = 'fa-unlock-alt'; + $visibilityIcon = 'fa-unlock'; $visibilityTitle = Yii::t('CfilesModule.base', 'This folder is public.'); } else { $visibilityIcon = 'fa-lock'; $visibilityTitle = Yii::t('CfilesModule.base', 'This folder is private.'); } -$visibilityIcon = $folder->content->isPublic() ? 'fa-unlock-alt': 'fa-lock' ; +$visibilityIcon = $folder->content->isPublic() ? 'fa-unlock': 'fa-lock' ; ?>
diff --git a/widgets/views/fileSelectionMenu.php b/widgets/views/fileSelectionMenu.php index 0866136..6a31b9d 100644 --- a/widgets/views/fileSelectionMenu.php +++ b/widgets/views/fileSelectionMenu.php @@ -52,7 +52,7 @@ class="caret"> data-action-submit data-fid="id ?>" data-action-url=""> - +
  • @@ -79,4 +79,4 @@ class="caret">
  • - \ No newline at end of file +