-
Notifications
You must be signed in to change notification settings - Fork 426
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
Add upload fixed image in badge designer #5273
Add upload fixed image in badge designer #5273
Conversation
0a80515
to
d319be8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! There were a few ESLint problems, but not worth reviewing those since we can refactor this file in a single commit before merging.
@ThiefMaster since there's currently more than one fixed element, what do you think about having both the |
5e7f46f
to
dccfae9
Compare
Hello, please can we merge this PR if it looks good, so we can include it in our next release |
Since you need to backport it anyway, I guess it'd be fine for you if we merged it into master and not 3.1.x? |
Yes, it'll be fine |
Unless I'm blind we never check that the |
Yes you are correct, there is no check that the image_id belongs to the template. I can add a check for it. |
d3ceeef
to
ae52d2b
Compare
new_template = DesignerTemplate(title=title, type=self.template.type, **self.target_dict) | ||
|
||
data = self.template.data | ||
image_items = [(i, item) for i, item in enumerate(data['items']) if item['type'] == 'fixed_image'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the enumerate
is needed, there's no need to use an index. When you iterate over a list of items and mutate an item, it will change the item in the list.
4f33f92
to
0b273cf
Compare
9bab81d
to
ec66a88
Compare
3de0774
to
3ce26c4
Compare
This adds an option to upload images specific to the badge from the badge designer.
The image can be added from the 'insert elements' dropdown list and is called
Fixed image
Multiple Fixed images can be added to the badge.