fixed: builder and end-user were able to see the add workspace cta even if the flag is off (#12549)

This commit is contained in:
Muhsin Shah C P 2025-04-11 13:28:22 +05:30 committed by GitHub
parent c9493259ba
commit 41edf99eb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,8 @@ const BaseWorkspaceActions = ({
}) => {
//If License ToolTip component is not passed from version specific component--> We will show normal ToolTip component
const isDefaultLicenseTooltip = LicenseTooltip === DefaultLicenseTooltip;
const isAllowPersonalWorkspace = window.public_config?.ALLOW_PERSONAL_WORKSPACE === 'true';
return (
<div
className="d-flex"
@ -24,21 +26,23 @@ const BaseWorkspaceActions = ({
</div>
</ToolTip>
) : (
<LicenseTooltip
limits={workspacesLimit}
feature={'workspaces'}
placement="top"
customTitle="Add new workspace"
isAvailable={true}
>
<div
disabled={!workspacesLimit.canAddUnlimited && workspacesLimit?.percentage >= 100}
onClick={handleAddWorkspace}
style={{ marginLeft: super_admin ? '0px' : '10px' }}
>
<SolidIcon name="plus" fill="var(--icon-strong)" dataCy="add-new-workspace-link" width="17" />
</div>
</LicenseTooltip>
(isAllowPersonalWorkspace || super_admin) && (
<LicenseTooltip
limits={workspacesLimit}
feature={'workspaces'}
placement="top"
customTitle="Add new workspace"
isAvailable={true}
>
<div
disabled={!workspacesLimit.canAddUnlimited && workspacesLimit?.percentage >= 100}
onClick={handleAddWorkspace}
style={{ marginLeft: super_admin ? '0px' : '10px' }}
>
<SolidIcon name="plus" fill="var(--icon-strong)" dataCy="add-new-workspace-link" width="17" />
</div>
</LicenseTooltip>
)
)}
</div>
);