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

EZEE-3479: As a developer I want to have reusable componenet for charts #1705

Conversation

lucasOsti
Copy link
Contributor

@lucasOsti lucasOsti commented Feb 8, 2021

Question Answer
Tickets https://issues.ibexa.co/browse/EZEE-3479
Related to https://github.com/ezsystems/ezplatform-personalization/pull/176
Bug fix? no
New feature? yes
BC breaks? no
Tests pass? no
Doc needed? no
License GPL-2.0

Added reusable component for chart

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@lucasOsti lucasOsti marked this pull request as draft February 8, 2021 13:17
@lucasOsti lucasOsti marked this pull request as ready for review February 8, 2021 13:32
@lucasOsti lucasOsti marked this pull request as draft February 8, 2021 14:00
@lucasOsti lucasOsti changed the title EZEE-3479: As a developer I want to have reusable componenet for charts [WIP] EZEE-3479: As a developer I want to have reusable componenet for charts Feb 8, 2021
@lucasOsti lucasOsti changed the title [WIP] EZEE-3479: As a developer I want to have reusable componenet for charts EZEE-3479: As a developer I want to have reusable componenet for charts Feb 8, 2021
@lucasOsti lucasOsti marked this pull request as ready for review February 8, 2021 14:53
@lucasOsti lucasOsti marked this pull request as draft February 9, 2021 08:57
@lucasOsti lucasOsti changed the title EZEE-3479: As a developer I want to have reusable componenet for charts [WIP] EZEE-3479: As a developer I want to have reusable componenet for charts Feb 9, 2021
getScalesYAxesOption() {
let YAxes = [];

if (this.type === 'line') {
Copy link
Member

Choose a reason for hiding this comment

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

this.type this is never set in this base class and this class definitely should not know what are the values of this properties

@lucasOsti lucasOsti marked this pull request as ready for review February 10, 2021 13:04
@lucasOsti lucasOsti changed the title [WIP] EZEE-3479: As a developer I want to have reusable componenet for charts EZEE-3479: As a developer I want to have reusable componenet for charts Feb 10, 2021
@lucasOsti lucasOsti force-pushed the EZEE-3479-As-a-developer-I-want-to-have-reusable-componenet-for-charts branch from f35f17f to 3a81701 Compare February 10, 2021 13:11
checkbox.style.backgroundColor = checkedColor;
checkbox.style.borderColor = checkedColor;
} else {
checkbox.style.backgroundColor = '#fff';
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put colors to constants at the beginning of file


render() {
this.chart = new Chart(this.canvas.getContext('2d'), {
type: this.getType(),
Copy link
Member

Choose a reason for hiding this comment

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

getType is not defined in this class

options: {
responsive: true,
maintainAspectRatio: false,
layout: this.layoutOptions(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
layout: this.layoutOptions(),
layout: this.getLayoutOptions(),

?

chartNode.classList[chartMethod]('ez-chart--no-data');
},
},
scales: this.scaleOptions(),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
scales: this.scaleOptions(),
scales: this.getScaleOptions(),

?

};
}

legendOptions(chart) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
legendOptions(chart) {
getLegendOptions(chart) {

?

Copy link
Contributor

@tomaszszopinski tomaszszopinski left a comment

Choose a reason for hiding this comment

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

QA approved on Ibexa dxp 3.3.1-dev with patch.

@lserwatka lserwatka merged commit 35eda25 into ezsystems:master Feb 17, 2021
lucasOsti added a commit that referenced this pull request Feb 26, 2021
adamwojs pushed a commit that referenced this pull request Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants