From 450869756380d12eee506fe6499c7e95a616e797 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Wed, 27 Sep 2023 23:53:51 -0700 Subject: [PATCH 1/6] Update Post component, adding follow and unfollow methods. --- resources/assets/components/Post.vue | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/resources/assets/components/Post.vue b/resources/assets/components/Post.vue index 1cc57c84..6b336135 100644 --- a/resources/assets/components/Post.vue +++ b/resources/assets/components/Post.vue @@ -37,6 +37,8 @@ v-on:bookmark="handleBookmark()" v-on:share="shareStatus()" v-on:unshare="unshareStatus()" + v-on:follow="follow()" + v-on:unfollow="unfollow()" v-on:counter-change="counterChange" /> @@ -333,6 +335,30 @@ }) }, + follow() { + axios.post('/api/v1/accounts/' + this.post.account.id + '/follow') + .then(res => { + this.$store.commit('updateRelationship', [res.data]); + this.user.following_count++; + this.post.account.followers_count++; + }).catch(err => { + swal('Oops!', 'An error occurred when attempting to follow this account.', 'error'); + this.post.relationship.following = false; + }); + }, + + unfollow() { + axios.post('/api/v1/accounts/' + this.post.account.id + '/unfollow') + .then(res => { + this.$store.commit('updateRelationship', [res.data]); + this.user.following_count--; + this.post.account.followers_count--; + }).catch(err => { + swal('Oops!', 'An error occurred when attempting to unfollow this account.', 'error'); + this.post.relationship.following = true; + }); + }, + openContextMenu() { this.$nextTick(() => { this.$refs.contextMenu.open(); From 6c1e56fcb2bc5ffc135ba328aef496b8761a54c2 Mon Sep 17 00:00:00 2001 From: mbliznikova Date: Wed, 4 Oct 2023 19:02:55 +0000 Subject: [PATCH 2/6] Provide the error message if a file to upload is too large --- resources/assets/js/components/ComposeModal.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/resources/assets/js/components/ComposeModal.vue b/resources/assets/js/components/ComposeModal.vue index 578679d3..a4737294 100644 --- a/resources/assets/js/components/ComposeModal.vue +++ b/resources/assets/js/components/ComposeModal.vue @@ -1068,6 +1068,16 @@ export default { return App.util.format.timeAgo(ts); }, + formatBytes(bytes, decimals = 2) { + if (!+bytes) { + return '0 Bytes' + } + const dec = decimals < 0 ? 0 : decimals + const units = ['Bytes', 'KB', 'MB', 'GB', 'TB']; + const quotient = Math.floor(Math.log(bytes) / Math.log(1024)) + return `${parseFloat((bytes / Math.pow(1024, quotient)).toFixed(dec))} ${units[quotient]}` + }, + fetchProfile() { let tags = { public: 'Public', @@ -1178,6 +1188,13 @@ export default { }, 300); }).catch(function(e) { switch(e.response.status) { + case 413: + self.uploading = false; + io.value = null; + swal('File is too large', 'The file you uploaded has the size of ' + self.formatBytes(io.size) + '. Unfortunately, only images up to ' + self.formatBytes(self.config.uploader.max_photo_size * 1024) + ' are supported.\nPlease resize the file and try again.', 'error'); + self.page = 2; + break; + case 451: self.uploading = false; io.value = null; From e9d9c4d8cc2965fd0eb1ebfc31b96dfc9a6ff7d5 Mon Sep 17 00:00:00 2001 From: Andy Neillans Date: Wed, 11 Oct 2023 19:08:22 +0100 Subject: [PATCH 3/6] Strip tags from bio in embeds --- resources/views/profile/show.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/profile/show.blade.php b/resources/views/profile/show.blade.php index d16eeb7c..5107c0ab 100644 --- a/resources/views/profile/show.blade.php +++ b/resources/views/profile/show.blade.php @@ -20,7 +20,7 @@ @endsection -@push('meta') +@push('meta') @if(false == $settings['crawlable'] || $profile->remote_url) @else From b838f90b776ce2bbc8dad797c3a4bf80f40f99c7 Mon Sep 17 00:00:00 2001 From: mbliznikova Date: Fri, 20 Oct 2023 21:09:29 +0000 Subject: [PATCH 4/6] Add check if collection is empty in Edit Collection before publishing --- .../js/components/CollectionComponent.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/components/CollectionComponent.vue b/resources/assets/js/components/CollectionComponent.vue index dd7ebf43..3f77cfc1 100644 --- a/resources/assets/js/components/CollectionComponent.vue +++ b/resources/assets/js/components/CollectionComponent.vue @@ -205,12 +205,20 @@
+ +