New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enh: [RFC] [WIP] Make profile image handling generic and re-usable for any content #6408
base: develop
Are you sure you want to change the base?
Conversation
@martin-rueegg Thanks for the contribution. This looks very interesting. Unfortunately, extended flexibility often brings a lot of complexity. We always have to weigh things up here. Please give me some time to take a closer look into the PR/idea. |
Hi @luke- Thank you for your appreciative comment. I'm still working on this as some incompatibilities with the changes that happened during my time-away. I will also try to isolate some changes to the code that are not inseparable from the feature (e.g. introduction of interfaces) into separate commits and add some "documentation". |
8d4f0db
to
a73a17e
Compare
Hi @luke- I've tried to split this mammoth PR into some smaller logical chunks: Please have a look at the original post of this PR for further details (under section Happy to discuss details and how to proceed. |
a73a17e
to
e12649a
Compare
@martin-rueegg Hi Martin, thanks for splitting the PR. It makes it much easier to discuss & review it. I already had a first very quick look at the Statable PR and I really like it. I still need some time to dig deeper into it, but I'll comment directly in the respective PR with my feedback/ideas. |
e12649a
to
61e871c
Compare
61e871c
to
629062c
Compare
The feature to upload and display profile and banner images exists for Users and Spaces. However, this functionality is useful also for other content as well as potentially other content types (once extendable).
This patch aims to make the code re-usable for other content, allowing to customize configuration, actions and permissions based on interfaces and events.
All changes have the streamlining of code in mind and some changes can later be built on, eg. the Interfaces for permission checks. They could be used in other areas of the project or modules.
Current State
Work-in-progress, comments welcome. Still needs testing and potentially some amendments after discussion.
The PR has been broken down in different commit groups:
FindInstanceInterface
- Part 1.a: Creating base classes #6503FindInstanceInterface
- Part 2: Implementing throughout the code #6463status
tostate
in User, Space, & Membership #6517file
table and implement interfaces #6523The CHANGELOG has not been updated in the individual junks for now.
1. Statable interfaces
See #6430 (comment)
2. Introduce Deletable, Editable, Readable, & Viewable Interfaces
See #6451
Also introducing the above mentioned interfaces had the intention to standardize the methods, but also the detectability thereof. It has also been suggested in the code.
3. Minor changes
Some reformatting and small code changes that do not really fit in any of the other chunks
4. Introduce state and other fields to
file
tableUpdating the fields follows up on a forum discussion and also implements the interfaces up until here.
5. Make profile image handling generic and re-usable
Last but not least, making the image upload more generic allows to reuse the code for other post types or attachments, not only for profile images and banners.
About this PR
What kind of change does this PR introduce?
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
develop
branch, not themaster
branch if no hotfix