Merge pull request #2828 from pixelfed/staging

Staging
This commit is contained in:
daniel 2021-06-29 01:30:28 -06:00 committed by GitHub
commit 48dd65144d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 50 additions and 2310 deletions

View file

@ -31,6 +31,9 @@
- Updated NetworkTimeline, fix remote comment urls. ([308acc91](https://github.com/pixelfed/pixelfed/commit/308acc91)) - Updated NetworkTimeline, fix remote comment urls. ([308acc91](https://github.com/pixelfed/pixelfed/commit/308acc91))
- Updated Timeline component, abstracted reusable partials. ([858f3f9e](https://github.com/pixelfed/pixelfed/commit/858f3f9e)) - Updated Timeline component, abstracted reusable partials. ([858f3f9e](https://github.com/pixelfed/pixelfed/commit/858f3f9e))
- Updated Timeline, fix suggested posts. ([3ba5c88c](https://github.com/pixelfed/pixelfed/commit/3ba5c88c)) - Updated Timeline, fix suggested posts. ([3ba5c88c](https://github.com/pixelfed/pixelfed/commit/3ba5c88c))
- Updated Timeline, disable new post update checker and hide reaction bar on network timeline. ([1e3d3a69](https://github.com/pixelfed/pixelfed/commit/1e3d3a69))
- Updated PublicApiController, improve network timeline perf. ([e5f683fd](https://github.com/pixelfed/pixelfed/commit/e5f683fd))
- Updated Network Timeline, use existing Timeline component. ([0deaafc0](https://github.com/pixelfed/pixelfed/commit/0deaafc0))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0) ## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)

View file

@ -15,7 +15,7 @@ use App\{
StatusView, StatusView,
UserFilter UserFilter
}; };
use Auth,Cache; use Auth, Cache;
use Carbon\Carbon; use Carbon\Carbon;
use League\Fractal; use League\Fractal;
use App\Transformer\Api\{ use App\Transformer\Api\{
@ -27,6 +27,8 @@ use App\Transformer\Api\{
use App\Services\{ use App\Services\{
AccountService, AccountService,
PublicTimelineService, PublicTimelineService,
StatusService,
SnowflakeService,
UserFilterService UserFilterService
}; };
use App\Jobs\StatusPipeline\NewStatusPipeline; use App\Jobs\StatusPipeline\NewStatusPipeline;
@ -498,6 +500,7 @@ class PublicApiController extends Controller
$max = $request->input('max_id'); $max = $request->input('max_id');
$limit = $request->input('limit') ?? 3; $limit = $request->input('limit') ?? 3;
$user = $request->user(); $user = $request->user();
$amin = SnowflakeService::byDate(now()->subDays(90));
$key = 'user:last_active_at:id:'.$user->id; $key = 'user:last_active_at:id:'.$user->id;
$ttl = now()->addMinutes(5); $ttl = now()->addMinutes(5);
@ -513,61 +516,41 @@ class PublicApiController extends Controller
$timeline = Status::select( $timeline = Status::select(
'id', 'id',
'uri', 'uri',
'caption',
'rendered',
'profile_id',
'type', 'type',
'in_reply_to_id',
'reblog_of_id',
'is_nsfw',
'scope', 'scope',
'local',
'reply_count',
'comments_disabled',
'place_id',
'likes_count',
'reblogs_count',
'created_at', 'created_at',
'updated_at'
)->where('id', $dir, $id) )->where('id', $dir, $id)
->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album']) ->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
->whereNotNull('uri') ->whereNotNull('uri')
->whereScope('public') ->whereScope('public')
->where('created_at', '>', now()->subMonths(3)) ->where('id', '>', $amin)
->orderBy('created_at', 'desc') ->orderBy('created_at', 'desc')
->limit($limit) ->limit($limit)
->get(); ->get()
->map(function($s) {
return StatusService::get($s->id);
});
$res = $timeline->toArray();
} else { } else {
$timeline = Status::select( $timeline = Status::select(
'id', 'id',
'uri', 'uri',
'caption', 'type',
'rendered', 'scope',
'profile_id', 'created_at',
'type', )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
'in_reply_to_id', ->whereNotNull('uri')
'reblog_of_id', ->whereScope('public')
'is_nsfw', ->where('id', '>', $amin)
'scope', ->orderBy('created_at', 'desc')
'local', ->limit($limit)
'reply_count', ->get()
'comments_disabled', ->map(function($s) {
'created_at', return StatusService::get($s->id);
'place_id', });
'likes_count', $res = $timeline->toArray();
'reblogs_count',
'updated_at'
)->whereIn('type', ['photo', 'photo:album', 'video', 'video:album', 'photo:video:album'])
->with('profile', 'hashtags', 'mentions')
->whereNotNull('uri')
->whereScope('public')
->where('created_at', '>', now()->subMonths(3))
->orderBy('created_at', 'desc')
->simplePaginate($limit);
} }
$fractal = new Fractal\Resource\Collection($timeline, new StatusTransformer());
$res = $this->fractal->createData($fractal)->toArray();
return response()->json($res); return response()->json($res);
} }

Binary file not shown.

Binary file not shown.

BIN
public/js/profile.js vendored

Binary file not shown.

BIN
public/js/quill.js vendored

Binary file not shown.

BIN
public/js/rempos.js vendored

Binary file not shown.

BIN
public/js/rempro.js vendored

Binary file not shown.

BIN
public/js/search.js vendored

Binary file not shown.

BIN
public/js/status.js vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/timeline.js vendored

Binary file not shown.

BIN
public/js/vendor.js vendored

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -105,6 +105,7 @@
<status-card <status-card
:status="status" :status="status"
:reaction-bar="reactionBar"
v-on:status-delete="deleteStatus" v-on:status-delete="deleteStatus"
v-on:comment-focus="commentFocus" v-on:comment-focus="commentFocus"
/> />
@ -707,7 +708,8 @@
discover_feed: [], discover_feed: [],
recentFeed: this.scope === 'home' ? true : false, recentFeed: this.scope === 'home' ? true : false,
recentFeedMin: null, recentFeedMin: null,
recentFeedMax: null recentFeedMax: null,
reactionBar: this.scope === 'network' ? false : true
} }
}, },
@ -831,7 +833,8 @@
this.fetchHashtagPosts(); this.fetchHashtagPosts();
} }
// this.fetchStories(); // this.fetchStories();
this.rtw(); // this.rtw();
setTimeout(function() { setTimeout(function() {
document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) { document.querySelectorAll('.timeline .card-body .comments .comment-body a').forEach(function(i, e) {
i.href = App.util.format.rewriteLinks(i); i.href = App.util.format.rewriteLinks(i);
@ -902,10 +905,10 @@
if(self.ids.indexOf(d.id) == -1) { if(self.ids.indexOf(d.id) == -1) {
self.feed.push(d); self.feed.push(d);
self.ids.push(d.id); self.ids.push(d.id);
vids.push({ // vids.push({
sid: d.id, // sid: d.id,
pid: d.account.id // pid: d.account.id
}); // });
} }
}); });
this.min_id = Math.max(...this.ids).toString(); this.min_id = Math.max(...this.ids).toString();
@ -913,9 +916,9 @@
this.page += 1; this.page += 1;
$state.loaded(); $state.loaded();
this.loading = false; this.loading = false;
axios.post('/api/status/view', { // axios.post('/api/status/view', {
'_v': vids, // '_v': vids,
}); // });
} else { } else {
$state.complete(); $state.complete();
} }

View file

@ -74,7 +74,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="reactions my-1 pb-2"> <div v-if="reactionBar" class="reactions my-1 pb-2">
<h3 v-if="status.favourited" class="fas fa-heart text-danger pr-3 m-0 cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3> <h3 v-if="status.favourited" class="fas fa-heart text-danger pr-3 m-0 cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3>
<h3 v-else class="far fa-heart pr-3 m-0 like-btn text-dark cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3> <h3 v-else class="far fa-heart pr-3 m-0 like-btn text-dark cursor-pointer" title="Like" v-on:click="likeStatus(status, $event);"></h3>
<h3 v-if="!status.comments_disabled" class="far fa-comment text-dark pr-3 m-0 cursor-pointer" title="Comment" v-on:click="commentFocus(status, $event)"></h3> <h3 v-if="!status.comments_disabled" class="far fa-comment text-dark pr-3 m-0 cursor-pointer" title="Comment" v-on:click="commentFocus(status, $event)"></h3>
@ -140,6 +140,11 @@
recommended: { recommended: {
type: Boolean, type: Boolean,
default: false default: false
},
reactionBar: {
type: Boolean,
default: true
} }
}, },

View file

@ -1,49 +0,0 @@
Vue.component(
'notification-card',
require('./components/NotificationCard.vue').default
);
Vue.component(
'photo-presenter',
require('./components/presenter/PhotoPresenter.vue').default
);
Vue.component(
'video-presenter',
require('./components/presenter/VideoPresenter.vue').default
);
Vue.component(
'photo-album-presenter',
require('./components/presenter/PhotoAlbumPresenter.vue').default
);
Vue.component(
'video-album-presenter',
require('./components/presenter/VideoAlbumPresenter.vue').default
);
Vue.component(
'mixed-album-presenter',
require('./components/presenter/MixedAlbumPresenter.vue').default
);
Vue.component(
'post-menu',
require('./components/PostMenu.vue').default
);
Vue.component(
'network-timeline',
require('./components/NetworkTimeline.vue').default
);
Vue.component(
'announcements-card',
require('./components/AnnouncementsCard.vue').default
);
Vue.component(
'story-component',
require('./components/StoryTimelineComponent.vue').default
);

View file

@ -2,12 +2,12 @@
@section('content') @section('content')
<network-timeline></network-timeline> <timeline scope="network"></timeline>
@endsection @endsection
@push('scripts') @push('scripts')
<script type="text/javascript" src="{{ mix('js/network-timeline.js') }}"></script> <script type="text/javascript" src="{{ mix('js/timeline.js') }}"></script>
<script type="text/javascript" src="{{ mix('js/compose.js') }}"></script> <script type="text/javascript" src="{{ mix('js/compose.js') }}"></script>
<script type="text/javascript">window.App.boot();</script> <script type="text/javascript">window.App.boot();</script>
@endpush @endpush

8
webpack.mix.js vendored
View file

@ -27,18 +27,10 @@ mix.js('resources/assets/js/app.js', 'public/js')
.js('resources/assets/js/collections.js', 'public/js') .js('resources/assets/js/collections.js', 'public/js')
.js('resources/assets/js/profile-directory.js', 'public/js') .js('resources/assets/js/profile-directory.js', 'public/js')
.js('resources/assets/js/story-compose.js', 'public/js') .js('resources/assets/js/story-compose.js', 'public/js')
// .js('resources/assets/js/embed.js', 'public')
.js('resources/assets/js/direct.js', 'public/js') .js('resources/assets/js/direct.js', 'public/js')
.js('resources/assets/js/admin.js', 'public/js') .js('resources/assets/js/admin.js', 'public/js')
// .js('resources/assets/js/micro.js', 'public/js')
.js('resources/assets/js/rempro.js', 'public/js') .js('resources/assets/js/rempro.js', 'public/js')
.js('resources/assets/js/rempos.js', 'public/js') .js('resources/assets/js/rempos.js', 'public/js')
//.js('resources/assets/js/timeline_next.js', 'public/js')
// .js('resources/assets/js/memoryprofile.js', 'public/js')
// .js('resources/assets/js/my2020.js', 'public/js')
.js('resources/assets/js/network-timeline.js', 'public/js')
// .js('resources/assets/js/drive.js', 'public/js')
// .js('resources/assets/js/register.js', 'public/js')
.extract([ .extract([
'lodash', 'lodash',