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

Improvement/component renderer #234

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DimitriChauvel
Copy link
Member

ℹ️ Don't forget to modify the changelog.md before merging this branch.

@@ -103,6 +103,7 @@ Then('I expect {string} to be at position {int},{int}', (templateSelector, x, y)
expect(Math.trunc(parseInt(element.attr('x')))).eq(x);
expect(Math.trunc(parseInt(element.attr('y')))).eq(y);
});

Copy link
Member

Choose a reason for hiding this comment

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

no need to jump line here

document.querySelector('#root').innerHTML = '';
plugin.draw('root', readOnly.value);
document.querySelector('#view-port').innerHTML = '';
plugin.draw();
Copy link
Member

Choose a reason for hiding this comment

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

lack of consistency - no parameters here (vs line 85) ?

plugin.draw('root');
updateComponentsIds();
plugin.initDrawingContext();
plugin.draw();
Copy link
Member

Choose a reason for hiding this comment

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

same - lack of consistency - no parameters here (vs line 95) ?

Comment on lines +9 to +31
<svg class="model" overflow="visible" fill="#474262" width="230" height="50"
{% if hasX and hasY %}
x="{{ drawOption.x }}" y="{{ drawOption.y }}"
{% else %}
x="0" y="0"
{% endif %}
>
<rect class="background" width="100%" height="100%" rx="6" />

<svg x="6" y="6" width="38" height="38">
<rect fill="#9691B1" width="100%" height="100%" rx="5"/>
<g class="type-icon" fill="#474262" transform="translate(3 3)">{{ icon | safe }}</g>
</svg>

{% if hasError %}
<g class="component-error">
<svg xmlns="http://www.w3.org/2000/svg"
width="15" height="15"
x=200 y="10"
fill="yellow"
viewBox="0 0 512 512">
<path d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm32 224c0 17.7-14.3 32-32 32s-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32z"/>
</svg>
<g class="error-icon">
<svg width="15" height="15" x="200" y="10" fill="yellow" viewBox="0 0 512 512">
<path d="M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512
256 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24
24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm32 224c0 17.7-14.3 32-32
32s-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32z"
/>
</svg>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe I need explaination - what are theses changes and why need them ?

@@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `getDefinedAttributesByType` will now return nested attributes inside object, fix [this bug](https://github.com/ditrit/leto-modelizer-plugin-core/issues/203).

- Add `arrangeComponentsPosition` method in `DefaultDrawer` and `DefaultPlugin`
Copy link
Member

Choose a reason for hiding this comment

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

I dont see the addition of arrangeComponentsPosition method in DefaultDrawer and DefaultPlugin? The function already existed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants