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

Enable/disable charts feature #2147

Merged
merged 7 commits into from
Jan 9, 2024
Merged

Enable/disable charts feature #2147

merged 7 commits into from
Jan 9, 2024

Conversation

CDimonaco
Copy link
Member

@CDimonaco CDimonaco commented Jan 8, 2024

Description

This pr aims to enable and disable the charts feature, both in the backend/frontend.

By default the feature is enabled, can be disabled with a runtime env variable.

On the backend, a dedicated plug will return 501 for all the charts endpoint, when the feature is disabled.
On frontend, the chart components will not be displayed, instead a text with a dedicated copy is shown to the user.

Frontend result

image

How was this tested?

Automated tests

@CDimonaco CDimonaco self-assigned this Jan 8, 2024
@CDimonaco CDimonaco added enhancement New feature or request javascript Pull requests that update Javascript code elixir Pull requests that update Elixir code labels Jan 8, 2024
@CDimonaco CDimonaco marked this pull request as ready for review January 9, 2024 11:01
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Hey!
Good stuff.

lib/trento_web/plugs/charts_disabled_plug.ex Outdated Show resolved Hide resolved
lib/trento_web/plugs/unplug_charts_enabled_predicate.ex Outdated Show resolved Hide resolved
assets/js/common/ChartDisabledBox/ChartDisabledBox.jsx Outdated Show resolved Hide resolved
data-testid="chart-disabled-box"
>
<h2 className="font-bold text-center text-xl">
Charts are disabled, please check documentation for further details
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe Charts are disabled. Please check the documentation for further details.
Could we point the user to that documentation with a link?
Otherwise it doesn't look like that helpful

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but we don't have the docs yet, so atm I think we could have as is

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

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

Great!
Commented some other small leftovers.
No need for a new review

lib/trento_web/plugs/charts_disabled_plug.ex Outdated Show resolved Hide resolved
@CDimonaco CDimonaco merged commit 4d0791d into main Jan 9, 2024
26 checks passed
@CDimonaco CDimonaco deleted the enable_disable_charts branch January 9, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request javascript Pull requests that update Javascript code
Development

Successfully merging this pull request may close these issues.

None yet

2 participants