Skip to content

Commit

Permalink
Fix saving allowed teams in dataset settings (#6817)
Browse files Browse the repository at this point in the history
* fix saving allowed teams in dataset settings

* update changelog

---------

Co-authored-by: Jonathan Striebel <[email protected]>
  • Loading branch information
philippotto and jstriebel authored Feb 6, 2023
1 parent c9c481b commit b9fbf1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Fixed
- Fixed a benign error message which briefly appeared after logging in. [#6810](https://github.com/scalableminds/webknossos/pull/6810)
- Fixed saving allowed teams in dataset settings [#6817](https://github.com/scalableminds/webknossos/pull/6817)

### Removed

Expand Down
17 changes: 16 additions & 1 deletion frontend/javascripts/components/pricing_enforcers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,26 @@ export const PricingEnforcedButton: React.FunctionComponent<RequiredPricingProps
export const PricingEnforcedBlur: React.FunctionComponent<RequiredPricingProps> = ({
children,
requiredPricingPlan,
...restProps
}) => {
const activeOrganization = useSelector((state: OxalisState) => state.activeOrganization);
const isFeatureAllowed = isFeatureAllowedByPricingPlan(activeOrganization, requiredPricingPlan);

if (isFeatureAllowed) return <>{children}</>;
if (isFeatureAllowed)
// Spread additional props to the children (required since antd's form implementation
// typically fills value and onChange props on children of FormItems).
return (
<>
{React.Children.map(children, (child) => {
if (!React.isValidElement(child)) {
return child;
}
return React.cloneElement(child, {
...restProps,
});
})}
</>
);

return (
<Tooltip title={messages["organization.plan.feature_not_available"](requiredPricingPlan)}>
Expand Down

0 comments on commit b9fbf1e

Please sign in to comment.