Skip to content

Commit

Permalink
Fix Changelog, tests, and moved feature.free flag to freePlan
Browse files Browse the repository at this point in the history
  • Loading branch information
TerrySmithDC committed Nov 19, 2019
1 parent 8b3f93c commit 42f4322
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.0] - 2019-11-19
## [Unreleased]

### Added

- Free features data to plan selector custom event. (#743)

## [0.7.0] - 2019-11-19

### Added

- Added `metrics` property to `<manifold-connection>` to opt-in for metric collection (#724)
Expand Down
8 changes: 3 additions & 5 deletions docs/docs/components/manifold-plan-selector.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,16 @@ document.addEventListener('manifold-planSelector-change', ({ detail }) => {
// planLabel: 'nvidia-1080ti-100gb-ssd',
// planName: 'NVIDIA 1080TI',
// productLabel: 'zerosix',
// features: {
// free: false
// },
// freePlan: false
// }
```

The following events are emitted:

| Event Name | Description | Data |
| :----------------------------- | :------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- |
| `manifold-planSelector-change` | Fires whenever a user makes a change. | `planID`, `planLabel`, `planName`, `productId`, `productLabel`, `regionId`, `regionName`, `features` |
| `manifold-planSelector-load` | Identical to `-update` above, but this fires once on DOM mount to set the initial state (i.e. user hasn’t interacted yet). | `planID`, `planLabel`, `planName`, `productId`, `productLabel`, `regionId`, `regionName`, `features` |
| `manifold-planSelector-change` | Fires whenever a user makes a change. | `planID`, `planLabel`, `planName`, `productId`, `productLabel`, `regionId`, `regionName`, `freePlan` |
| `manifold-planSelector-load` | Identical to `-update` above, but this fires once on DOM mount to set the initial state (i.e. user hasn’t interacted yet). | `planID`, `planLabel`, `planName`, `productId`, `productLabel`, `regionId`, `regionName`, `freePlan` |

## Free plans only

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('<manifold-plan-details>', () => {
productLabel: product.label,
regionId: region && region.id,
regionName: region && region.displayName,
freePlan: paidPlan.free,
},
})
);
Expand Down Expand Up @@ -77,6 +78,7 @@ describe('<manifold-plan-details>', () => {
productLabel: product.label,
regionId: region && region.id,
regionName: region && region.displayName,
freePlan: freePlan.free,
},
})
);
Expand Down
20 changes: 5 additions & 15 deletions src/components/manifold-plan-details/manifold-plan-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ interface EventDetail {
productLabel: string | undefined;
regionId?: string;
regionName?: string;
feature?: {
free: boolean;
};
freePlan: boolean;
}

@Component({
Expand Down Expand Up @@ -51,9 +49,7 @@ export class ManifoldPlanDetails {
productLabel: this.product && this.product.label,
regionId: defaultRegion && defaultRegion.id,
regionName: defaultRegion && defaultRegion.displayName,
feature: {
free: newPlan.free,
},
freePlan: newPlan.free,
};

if (!oldPlan) {
Expand Down Expand Up @@ -89,9 +85,7 @@ export class ManifoldPlanDetails {
productLabel: this.product && this.product.label,
regionId: defaultRegion && defaultRegion.id,
regionName: defaultRegion && defaultRegion.displayName,
feature: {
free: this.plan.free,
},
freePlan: this.plan.free,
};
this.planLoad.emit(detail);
// reset features
Expand All @@ -112,9 +106,7 @@ export class ManifoldPlanDetails {
productLabel: this.product.label,
regionId: defaultRegion && defaultRegion.id,
regionName: defaultRegion && defaultRegion.displayName,
feature: {
free: this.plan.free,
},
freePlan: this.plan.free,
};
this.planUpdate.emit(detail);
}
Expand All @@ -135,9 +127,7 @@ export class ManifoldPlanDetails {
productLabel: this.product.label,
regionId: e.detail.value,
regionName: defaultRegion && defaultRegion.displayName,
feature: {
free: this.plan.free,
},
freePlan: this.plan.free,
};
this.planUpdate.emit(detail);
}
Expand Down

0 comments on commit 42f4322

Please sign in to comment.