Skip to content
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

[REFACTOR] Rename icon methods in IconPainter to reflect what is drawing #810

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

csouchet
Copy link
Member

No description provided.

@csouchet csouchet added the refactoring Code refactoring label Oct 21, 2020
@csouchet csouchet added this to the 0.5.1 milestone Oct 21, 2020
@@ -354,7 +354,7 @@ export default class IconPainter {
/**
* This icon is used by `user task`.
*/
public paintUserIcon({ c, ratioFromParent, setIconOrigin, shape, icon }: PaintParameter): void {
public paintPersonIcon({ c, ratioFromParent, setIconOrigin, shape, icon }: PaintParameter): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ why changing this one? I don't get what is the clarification/generalization here. It has already been renamed recently, see https://github.com/process-analytics/bpmn-visualization-js/pull/522/files#diff-5e09027c60c84ce5c53f738dd6ad77bbc15f103d8e0b99de725c8424d7cc2339R307
Be aware that changing this will break the custom icon example

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, it represents more a person than a user.
In my opinion, the term 'User' is just to add context to a task.

This icon can be used anywhere (but not sure if we re-use it), but not in the context of 'User'.

Good catch for the examples 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for general context Person sounds better - so it depends if we want to reuse it elsewhere or just for task-icon

I would even propose to name it paintFemalePersonIcon as it actually draws a female :)

Copy link
Member Author

@csouchet csouchet Oct 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We changed paintWomanIcon in paintUserIcon in the past, in order to allow to a developper to change woman to man.

In my opinion the icon painter should reflect only what it paints. And the class/method who uses it should add the context.
Maybe, an intermerdiate method is missing in the task-shapes file to call the paintWomanIcon (whatever its name). And the developper should override this missing method and not the woman method if he wants to use a man icon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that makes sense 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, do I rename it in paintWomanIcon ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant ok for eventual intermediate method and overriding

here it is OK to stay with Person, for me, you can merge as it is (just remember about examples mentioned by Thomas)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@csouchet csouchet requested a review from aibcmars October 21, 2020 16:04
@csouchet csouchet force-pushed the rename_icon_painter_method branch 3 times, most recently from c60fa88 to d8a0b03 Compare October 22, 2020 08:56
Copy link
Contributor

@aibcmars aibcmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@csouchet csouchet force-pushed the rename_icon_painter_method branch 2 times, most recently from 7964f69 to b0c1716 Compare October 22, 2020 12:48
@csouchet csouchet force-pushed the rename_icon_painter_method branch from b0c1716 to b3b9207 Compare October 22, 2020 16:35
@csouchet csouchet merged commit 3c6be4d into master Oct 23, 2020
@csouchet csouchet deleted the rename_icon_painter_method branch October 23, 2020 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants