User media management, FE part #3603

Open
vaartis wants to merge 11 commits from media-management into develop
Member

Checklist

  • Adding a changelog: In the changelog.d directory, create a file named <code>.<type>.

Required BE PR: pleroma/pleroma#8058

This implements the new endpoints for managing user's uploaded media:

  • Lists user's uploaded media with some information about it
  • Allows the user to check in which posts this attachment was used and whether there are duplicate files on the server
  • Allows the user to delete the attachment from the server, provided it is not used in any post

Issues:

  • It ain't pretty
  • I couldn't figure out how to make the spinner look good for the Duplicates section
  • "Used in" is just a list of links to posts

Screenshots:
image
image

### Checklist - [x] Adding a changelog: In the `changelog.d` directory, create a file named `<code>.<type>`. Required BE PR: pleroma/pleroma#8058 This implements the new endpoints for managing user's uploaded media: - Lists user's uploaded media with some information about it - Allows the user to check in which posts this attachment was used and whether there are duplicate files on the server - Allows the user to delete the attachment from the server, provided it is not used in any post Issues: - It ain't pretty - I couldn't figure out how to make the spinner look good for the Duplicates section - "Used in" is just a list of links to posts Screenshots: ![image](/attachments/f3151dcc-d233-4dfa-9036-c840ff968390) ![image](/attachments/fed63107-307a-460a-904a-92aac6c171ec)
Still missing at least pagination
Backend now gives an attachment-shaped object, so it can be used with
the attachment component
Changelog
Some checks failed
ci/woodpecker/pr/test-e2e Pipeline is pending
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was canceled
1c4e7ab12c
Only refresh media if management is available
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
1aa1e0a242
hj requested changes 2026-11-05 15:04:23 +00:00
@ -0,0 +11,4 @@
<button class="btn button-default" @click="refreshMedia()">{{ $t('settings.uploaded_media.refresh') }}</button>
<div>
<div class="media-entry" v-for="media in knownMedia">
Member

needs an id attribute

needs an `id` attribute
Member

i meant key, sorry

i meant `key`, sorry
vaartis marked this conversation as resolved
@ -0,0 +55,4 @@
<li>
<h4>{{$t('settings.uploaded_media.used_in')}}</h4>
<ul v-if="media.usage" class="used-in-objects-list">
<li v-for="obj in media.usage.objects">
Member

also needs a key

also needs a `key`
vaartis marked this conversation as resolved
@ -0,0 +107,4 @@
</div>
</template>
<script>
Member

please move js and css into separate files

please move js and css into separate files
vaartis marked this conversation as resolved
@ -0,0 +157,4 @@
: 'settings.uploaded_media.delete_error',
level: result ? 'success' : 'error',
})
this.deleteModalVisible = false
Member

i would put this into .finally()

i would put this into `.finally()`
vaartis marked this conversation as resolved
@ -0,0 +154,4 @@
useInterfaceStore().pushGlobalNotice({
messageKey: result
? 'settings.uploaded_media.delete_success'
: 'settings.uploaded_media.delete_error',
Member

wouldn't failures just end up in .catch?

wouldn't failures just end up in `.catch`?
vaartis marked this conversation as resolved
@ -0,0 +200,4 @@
},
computed: {
managementAvailable() {
return useInstanceCapabilitiesStore().mediaManagementAvailable
Member

i would use pinia's mapState

i would use pinia's `mapState`
vaartis marked this conversation as resolved
Member

Overall looks good, just have a few nitpicks

Overall looks good, just have a few nitpicks
Separate JS and CSS and address issues from the PR
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
a50f4e4dad
Lint
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
14860d1dd3
Update to use new endpoint that supports throttling
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
8fd9e66471
All checks were successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/changelog Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/test-e2e Pipeline was successful
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin media-management:media-management
git switch media-management

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch develop
git merge --no-ff media-management
git switch media-management
git rebase develop
git switch develop
git merge --ff-only media-management
git switch media-management
git rebase develop
git switch develop
git merge --no-ff media-management
git switch develop
git merge --squash media-management
git switch develop
git merge --ff-only media-management
git switch develop
git merge media-management
git push origin develop
Sign in to join this conversation.
No reviewers
hj
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma-fe!3603
No description provided.