mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: change rollout datatype to int
Gradual rollout has the rollout property specified as a string in both the client spec tests and our API docs and the Rust SDK expects that contract to be upheld. This commit changes the datatype of rollout from an int to a string
This commit is contained in:
parent
3850cb42bd
commit
d8d510be22
@ -114,7 +114,7 @@ describe('feature', () => {
|
|||||||
expect(req.body.name).to.equal('flexibleRollout');
|
expect(req.body.name).to.equal('flexibleRollout');
|
||||||
expect(req.body.parameters.groupId).to.equal(featureToggleName);
|
expect(req.body.parameters.groupId).to.equal(featureToggleName);
|
||||||
expect(req.body.parameters.stickiness).to.equal('default');
|
expect(req.body.parameters.stickiness).to.equal('default');
|
||||||
expect(req.body.parameters.rollout).to.equal(30);
|
expect(req.body.parameters.rollout).to.equal('30');
|
||||||
|
|
||||||
if (enterprise) {
|
if (enterprise) {
|
||||||
expect(req.body.constraints.length).to.equal(1);
|
expect(req.body.constraints.length).to.equal(1);
|
||||||
@ -160,7 +160,7 @@ describe('feature', () => {
|
|||||||
req => {
|
req => {
|
||||||
expect(req.body.parameters.groupId).to.equal('new-group-id');
|
expect(req.body.parameters.groupId).to.equal('new-group-id');
|
||||||
expect(req.body.parameters.stickiness).to.equal('sessionId');
|
expect(req.body.parameters.stickiness).to.equal('sessionId');
|
||||||
expect(req.body.parameters.rollout).to.equal(60);
|
expect(req.body.parameters.rollout).to.equal('60');
|
||||||
|
|
||||||
if (enterprise) {
|
if (enterprise) {
|
||||||
expect(req.body.constraints.length).to.equal(1);
|
expect(req.body.constraints.length).to.equal(1);
|
||||||
|
@ -44,7 +44,7 @@ const FlexibleStrategy = ({
|
|||||||
e: React.ChangeEvent<{}>,
|
e: React.ChangeEvent<{}>,
|
||||||
value: number | number[]
|
value: number | number[]
|
||||||
) => {
|
) => {
|
||||||
updateParameter('rollout', value);
|
updateParameter('rollout', value.toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
const resolveStickiness = () =>
|
const resolveStickiness = () =>
|
||||||
@ -62,7 +62,7 @@ const FlexibleStrategy = ({
|
|||||||
|
|
||||||
const stickinessOptions = resolveStickiness();
|
const stickinessOptions = resolveStickiness();
|
||||||
|
|
||||||
const rollout = parameters.rollout !== undefined ? parameters.rollout : 100;
|
const rollout = parameters.rollout !== undefined ? parameters.rollout : '100';
|
||||||
const stickiness = parameters.stickiness;
|
const stickiness = parameters.stickiness;
|
||||||
const groupId = parameters.groupId;
|
const groupId = parameters.groupId;
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ const FlexibleStrategy = ({
|
|||||||
<div>
|
<div>
|
||||||
<RolloutSlider
|
<RolloutSlider
|
||||||
name="Rollout"
|
name="Rollout"
|
||||||
value={1 * rollout}
|
value={parseInt(rollout)}
|
||||||
disabled={!editable}
|
disabled={!editable}
|
||||||
onChange={updateRollout}
|
onChange={updateRollout}
|
||||||
/>
|
/>
|
||||||
|
@ -28,7 +28,7 @@ export interface IConstraint {
|
|||||||
|
|
||||||
export interface IParameter {
|
export interface IParameter {
|
||||||
groupId?: string;
|
groupId?: string;
|
||||||
rollout?: number;
|
rollout?: string;
|
||||||
stickiness?: string;
|
stickiness?: string;
|
||||||
|
|
||||||
[index: string]: any;
|
[index: string]: any;
|
||||||
|
Loading…
Reference in New Issue
Block a user