1
0
mirror of https://github.com/flarum/core.git synced 2025-08-15 12:54:47 +02:00

Compare commits

..

8 Commits

Author SHA1 Message Date
flarum-bot
777c304ab7 Bundled output for commit 789246b621
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-17 10:47:32 +00:00
Sami Mazouz
789246b621 fix(regression): slidable mark read showing for read discussions
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-17 11:37:33 +01:00
Sami Mazouz
980cfd6c28 Update prepare-release.yml 2023-05-17 09:51:06 +01:00
Sami Mazouz
65390a4fc0 test: patch phpstan error
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:57:57 +01:00
Sami Mazouz
c7c86a77e9 fix(regression): newCollection does not accept base collection
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:25:23 +01:00
Sami Mazouz
f1f6051deb fix(regression): lost spacing between tag label icon and text
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:21:04 +01:00
Sami Mazouz
bded3da42d fix(regression): queryVisibleTo accepts nullable actor
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-16 19:17:07 +01:00
Sami Mazouz
231cee1f78 fix(regression): newCollection accepts collections
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
2023-05-15 17:31:23 +01:00
11 changed files with 21 additions and 16 deletions

View File

@@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Prepare release - name: Prepare release
uses: flarum/action-release@master uses: flarum/action-release@master
env: with:
NEXT_TAG: ${{ inputs.version }} next_tag: ${{ inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
OPEN_COLLECTIVE_TOKEN: ${{ secrets.OPEN_COLLECTIVE_TOKEN }} open_collective_token: ${{ secrets.OPEN_COLLECTIVE_TOKEN }}

View File

@@ -44,7 +44,6 @@ class LoadLikesRelationship
$loadable = null; $loadable = null;
if ($data instanceof Discussion) { if ($data instanceof Discussion) {
// @phpstan-ignore-next-line
$loadable = $data->newCollection($data->posts)->filter(function ($post) { $loadable = $data->newCollection($data->posts)->filter(function ($post) {
return $post instanceof Post; return $post instanceof Post;
}); });

View File

@@ -47,8 +47,7 @@ class LoadMentionedByRelationship
$loadable = null; $loadable = null;
if ($data instanceof Discussion) { if ($data instanceof Discussion) {
// @phpstan-ignore-next-line $loadable = $data->newCollection($data->posts)->filter(function ($post) {
$loadable = $data->newCollection((array) $data->posts)->filter(function ($post) {
return $post instanceof Post; return $post instanceof Post;
}); });
} elseif ($data instanceof Collection) { } elseif ($data instanceof Collection) {

View File

@@ -19,6 +19,10 @@
&.colored &-text, &--colored &-text { &.colored &-text, &--colored &-text {
color: var(--tag-color) !important; color: var(--tag-color) !important;
} }
&-icon {
margin-right: 2px;
}
} }
.TagLabel { .TagLabel {

View File

@@ -26,7 +26,7 @@ class TagRepository
return Tag::query(); return Tag::query();
} }
public function queryVisibleTo(User $actor): Builder public function queryVisibleTo(?User $actor = null): Builder
{ {
return $this->scopeVisibleTo($this->query(), $actor); return $this->scopeVisibleTo($this->query(), $actor);
} }
@@ -114,7 +114,7 @@ class TagRepository
* @param User|null $user * @param User|null $user
* @return Builder<Tag> * @return Builder<Tag>
*/ */
protected function scopeVisibleTo(Builder $query, User $user = null) protected function scopeVisibleTo(Builder $query, ?User $user = null)
{ {
if ($user !== null) { if ($user !== null) {
$query->whereVisibleTo($user); $query->whereVisibleTo($user);

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -98,7 +98,7 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
return ( return (
<span <span
className={classList('Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic', { disabled: isUnread })} className={classList('Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic', { disabled: !isUnread })}
onclick={this.markAsRead.bind(this)} onclick={this.markAsRead.bind(this)}
> >
{icon('fas fa-check')} {icon('fas fa-check')}

View File

@@ -256,7 +256,10 @@ abstract class AbstractModel extends Eloquent
return $result; return $result;
} }
public function newCollection(array $models = []) /**
* @param \Illuminate\Support\Collection|array $models
*/
public function newCollection($models = [])
{ {
return new Collection($models); return new Collection($models);
} }

View File

@@ -41,7 +41,7 @@ class GroupRepository
return $this->scopeVisibleTo($query, $actor)->firstOrFail(); return $this->scopeVisibleTo($query, $actor)->firstOrFail();
} }
public function queryVisibleTo(User $actor = null) public function queryVisibleTo(?User $actor = null)
{ {
return $this->scopeVisibleTo($this->query(), $actor); return $this->scopeVisibleTo($this->query(), $actor);
} }
@@ -53,7 +53,7 @@ class GroupRepository
* @param User|null $actor * @param User|null $actor
* @return Builder<Group> * @return Builder<Group>
*/ */
protected function scopeVisibleTo(Builder $query, User $actor = null) protected function scopeVisibleTo(Builder $query, ?User $actor = null)
{ {
if ($actor !== null) { if ($actor !== null) {
$query->whereVisibleTo($actor); $query->whereVisibleTo($actor);

View File

@@ -29,7 +29,7 @@ class PostRepository
* @param User|null $user * @param User|null $user
* @return Builder<Post> * @return Builder<Post>
*/ */
public function queryVisibleTo(User $user = null) public function queryVisibleTo(?User $user = null)
{ {
$query = $this->query(); $query = $this->query();