Fix logic, enterprise is the only tier that can use this
This commit is contained in:
parent
bd5789f59c
commit
9a6a1abb84
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
const RemoveID = "remove"
|
const RemoveID = "remove"
|
||||||
|
const subType = $licensing.license.plan.type
|
||||||
|
|
||||||
$: enrichLabel = label => (labelPrefix ? `${labelPrefix} ${label}` : label)
|
$: enrichLabel = label => (labelPrefix ? `${labelPrefix} ${label}` : label)
|
||||||
$: options = getOptions(
|
$: options = getOptions(
|
||||||
|
@ -68,13 +69,19 @@
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Add creator if required
|
// Add creator if required
|
||||||
if (allowCreator) {
|
if (
|
||||||
|
allowCreator ||
|
||||||
|
subType === Constants.PlanType.ENTERPRISE ||
|
||||||
|
subType === Constants.PlanType.ENTERPRISE_BASIC
|
||||||
|
) {
|
||||||
options.unshift({
|
options.unshift({
|
||||||
_id: Constants.Roles.CREATOR,
|
_id: Constants.Roles.CREATOR,
|
||||||
name: "Can edit",
|
name: "Can edit",
|
||||||
tag:
|
tag:
|
||||||
!$licensing.perAppBuildersEnabled &&
|
subType === Constants.PlanType.ENTERPRISE ||
|
||||||
capitalise(Constants.PlanType.ENTERPRISE),
|
subType === Constants.PlanType.ENTERPRISE_BASIC
|
||||||
|
? null
|
||||||
|
: capitalise(Constants.PlanType.ENTERPRISE),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,9 +141,16 @@
|
||||||
getOptionValue={role => role._id}
|
getOptionValue={role => role._id}
|
||||||
getOptionColour={getColor}
|
getOptionColour={getColor}
|
||||||
getOptionIcon={getIcon}
|
getOptionIcon={getIcon}
|
||||||
isOptionEnabled={option =>
|
isOptionEnabled={option => {
|
||||||
option._id !== Constants.Roles.CREATOR ||
|
if (option._id === Constants.Roles.CREATOR) {
|
||||||
$licensing.perAppBuildersEnabled}
|
return (
|
||||||
|
subType === Constants.PlanType.ENTERPRISE ||
|
||||||
|
(subType === Constants.PlanType.ENTERPRISE_BASIC_TRIAL &&
|
||||||
|
$licensing.perAppBuildersEnabled)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
{error}
|
{error}
|
||||||
/>
|
/>
|
||||||
|
@ -154,10 +168,16 @@
|
||||||
getOptionValue={role => role._id}
|
getOptionValue={role => role._id}
|
||||||
getOptionColour={getColor}
|
getOptionColour={getColor}
|
||||||
getOptionIcon={getIcon}
|
getOptionIcon={getIcon}
|
||||||
isOptionEnabled={option =>
|
isOptionEnabled={option => {
|
||||||
(option._id !== Constants.Roles.CREATOR ||
|
if (option._id === Constants.Roles.CREATOR) {
|
||||||
$licensing.perAppBuildersEnabled) &&
|
return (
|
||||||
option.enabled !== false}
|
subType === Constants.PlanType.ENTERPRISE ||
|
||||||
|
(subType === Constants.PlanType.ENTERPRISE_BASIC_TRIAL &&
|
||||||
|
$licensing.perAppBuildersEnabled)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return option.enabled !== false
|
||||||
|
}}
|
||||||
{placeholder}
|
{placeholder}
|
||||||
{error}
|
{error}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue