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

FF-2465 Make orderPosition 1-indexed to match UI #105

Merged

Conversation

greghuels
Copy link
Contributor

@greghuels greghuels commented Jun 26, 2024

Motivation and Context

In the new "Assignment Details" object, orderPosition is confusing since it's 0-indexed, when the UI shows the assignments as 1-indexed.

See also: Eppo-exp/sdk-test-data#37 for test data fix

Description

Updates orderPosition so that it's now 1-indexed. This is part of the "Evaluation Reasons" work and will be merged in to the base branch for that feature.

How has this been tested?

local testing

Screenshot 2024-06-26 at 8 27 12 AM

Copy link
Contributor

@aarsilv aarsilv left a comment

Choose a reason for hiding this comment

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

Love how you're thinking of making this as user-friendly as possible!

@@ -62,7 +62,7 @@ export class Evaluator {
unmatchedAllocations.push({
key: allocation.key,
allocationEvaluationCode: code,
orderPosition: i,
orderPosition: i + 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -103,16 +103,17 @@ export class FlagEvaluationDetailsBuilder {
this.matchedAllocation = {
key: allocation.key,
allocationEvaluationCode: AllocationEvaluationCode.MATCH,
orderPosition,
orderPosition: indexPosition + 1, // orderPosition is 1-indexed to match UI
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the comment! 🙏

@greghuels greghuels merged commit e7e2dba into greg/FF-2465/evaluation-reasons Jun 27, 2024
1 of 2 checks passed
@greghuels greghuels deleted the greg/FF-2465/order-position-fix branch June 27, 2024 11:03
greghuels added a commit that referenced this pull request Jul 2, 2024
* FF-2465 rename flag-evaluation-details.ts to flag-evaluation-details-builder.ts

* FF-2465 make orderPosition 1-indexed to match UI

* FF-2465 include IAssignmentDetails in exports
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.

2 participants