-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(MCDA): 19032 Append units to custom axis labels in MCDA dropdown #805
feat(MCDA): 19032 Append units to custom axis labels in MCDA dropdown #805
Conversation
WalkthroughThe recent changes enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant axisDTOtoAxis
participant formatCustomBivariateAxisLabel
User->>axisDTOtoAxis: Call with AxisDTO
axisDTOtoAxis->>formatCustomBivariateAxisLabel: Check if dto.label exists
alt If dto.label exists
formatCustomBivariateAxisLabel->>axisDTOtoAxis: Return formatted label with quotients
else
axisDTOtoAxis->>formatBivariateAxisLabel: Call for default formatting
end
axisDTOtoAxis->>User: Return final axis object with label
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
Bundle size diff
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (3)
- src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (1 hunks)
- src/utils/bivariate/labelFormatters.test.ts (2 hunks)
- src/utils/bivariate/labelFormatters.ts (1 hunks)
Additional comments not posted (5)
src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (2)
1-4
: Import statements are correctly updated.The new
formatCustomLabelForBivariateAxis
function is correctly imported.
12-14
: Function logic is correctly updated.The
axisDTOtoAxis
function now usesformatCustomLabelForBivariateAxis
for custom label formatting ifdto.label
is provided. The fallback toformatBivariateAxisLabel
ensures backward compatibility.src/utils/bivariate/labelFormatters.ts (1)
13-22
: Function logic is correctly implemented.The
formatCustomLabelForBivariateAxis
function correctly formats custom labels with units derived from quotients. The fallback to return the custom label without units ensures robustness.src/utils/bivariate/labelFormatters.test.ts (2)
2-6
: Import statements are correctly updated.The new
formatCustomLabelForBivariateAxis
function is correctly imported.
126-183
: Tests are correctly implemented.The tests for the
formatCustomLabelForBivariateAxis
function correctly cover the scenarios where units are present and absent. The test cases are well-defined and ensure the function behaves as expected.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (3)
- src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (1 hunks)
- src/utils/bivariate/labelFormatters.test.ts (2 hunks)
- src/utils/bivariate/labelFormatters.ts (1 hunks)
Additional comments not posted (5)
src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (2)
1-4
: Import statement looks good.The import statement correctly includes
formatCustomBivariateAxisLabel
.
12-14
: Function logic looks good.The function correctly uses
formatCustomBivariateAxisLabel
whendto.label
is present and falls back toformatBivariateAxisLabel
otherwise.src/utils/bivariate/labelFormatters.ts (1)
13-19
: Function logic looks good.The function correctly formats the custom label with units derived from quotients.
src/utils/bivariate/labelFormatters.test.ts (2)
2-6
: Import statement looks good.The import statement correctly includes
formatCustomBivariateAxisLabel
.
126-183
: Test cases look good.The test cases correctly verify the behavior of
formatCustomBivariateAxisLabel
under different conditions.
…-mcda-dropdown-add-units-to-custom-axis-labels
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (1)
- src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (1 hunks)
Additional comments not posted (2)
src/utils/bivariate/helpers/converters/axisDTOtoAxis.ts (2)
1-4
: Imports look good!The import statement correctly includes
formatCustomBivariateAxisLabel
from~utils/bivariate/labelFormatters
.
12-14
: Conditional structure for label property looks good!The conditional structure for setting the
label
property is correctly implemented. It checks for the existence ofdto.label
and usesformatCustomBivariateAxisLabel
if present, otherwise falls back toformatBivariateAxisLabel
.
https://kontur.fibery.io/Tasks/Task/FE-MCDA-dropdown-add-units-to-custom-axis-labels-19032
Summary by CodeRabbit
New Features
Bug Fixes
Tests