@@ -17,6 +17,8 @@ import { tableEditColumnSize } from '../../shared/defguard-ui/components/table/c
1717import { TableBody } from '../../shared/defguard-ui/components/table/TableBody/TableBody' ;
1818import { TableCell } from '../../shared/defguard-ui/components/table/TableCell/TableCell' ;
1919import { isPresent } from '../../shared/defguard-ui/utils/isPresent' ;
20+ import { getLicenseInfoQueryOptions } from '../../shared/query' ;
21+ import { canUseBusinessFeature , licenseActionCheck } from '../../shared/utils/license' ;
2022
2123type RowData = AclAlias ;
2224
@@ -29,6 +31,10 @@ type Props = {
2931export const AliasTable = ( { data : rowData } : Props ) => {
3032 const navigate = useNavigate ( ) ;
3133
34+ const { data : licenseInfo , isFetching : isLicenseFetching } = useQuery (
35+ getLicenseInfoQueryOptions ,
36+ ) ;
37+
3238 const { data : rules } = useQuery ( {
3339 queryFn : api . acl . rule . getRules ,
3440 queryKey : [ 'acl' , 'rule' ] ,
@@ -124,11 +130,14 @@ export const AliasTable = ({ data: rowData }: Props) => {
124130 text : m . controls_edit ( ) ,
125131 icon : 'edit' ,
126132 onClick : ( ) => {
127- navigate ( {
128- to : '/acl/edit-alias' ,
129- search : {
130- alias : row . id ,
131- } ,
133+ if ( licenseInfo === undefined ) return ;
134+ licenseActionCheck ( canUseBusinessFeature ( licenseInfo ) , ( ) => {
135+ navigate ( {
136+ to : '/acl/edit-alias' ,
137+ search : {
138+ alias : row . id ,
139+ } ,
140+ } ) ;
132141 } ) ;
133142 } ,
134143 } ,
@@ -137,7 +146,10 @@ export const AliasTable = ({ data: rowData }: Props) => {
137146 icon : 'delete' ,
138147 variant : 'danger' ,
139148 onClick : ( ) => {
140- deleteAlias ( row . id ) ;
149+ if ( licenseInfo === undefined ) return ;
150+ licenseActionCheck ( canUseBusinessFeature ( licenseInfo ) , ( ) => {
151+ deleteAlias ( row . id ) ;
152+ } ) ;
141153 } ,
142154 } ,
143155 ] ,
@@ -148,19 +160,26 @@ export const AliasTable = ({ data: rowData }: Props) => {
148160 text : 'Deploy' ,
149161 icon : 'deploy' ,
150162 onClick : ( ) => {
151- applyAliases ( [ row . id ] ) ;
163+ if ( licenseInfo === undefined ) return ;
164+ licenseActionCheck ( canUseBusinessFeature ( licenseInfo ) , ( ) => {
165+ applyAliases ( [ row . id ] ) ;
166+ } ) ;
152167 } ,
153168 } ) ;
154169 }
155170 return (
156171 < TableCell >
157- < IconButtonMenu icon = "menu" menuItems = { menuItems } />
172+ < IconButtonMenu
173+ icon = "menu"
174+ menuItems = { menuItems }
175+ disabled = { isLicenseFetching }
176+ />
158177 </ TableCell >
159178 ) ;
160179 } ,
161180 } ) ,
162181 ] ,
163- [ rules , applyAliases , deleteAlias , navigate ] ,
182+ [ rules , applyAliases , deleteAlias , navigate , isLicenseFetching , licenseInfo ] ,
164183 ) ;
165184
166185 const table = useReactTable ( {
0 commit comments