Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions frontend/src/components/license/license-notification.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Alert, AlertDescription, AlertIcon, Box, Button, Flex } from '@redpanda-data/ui';
import { Link, useLocation } from '@tanstack/react-router';
import { useEffect } from 'react';
import { useStore } from 'zustand';

import {
coreHasEnterpriseFeatures,
Expand All @@ -13,15 +12,15 @@ import {
prettyLicenseType,
} from './license-utils';
import { License_Source, License_Type } from '../../protogen/redpanda/api/console/v1alpha1/license_pb';
import { api, useApiStore } from '../../state/backend-api';
import { api, useApiStoreHook } from '../../state/backend-api';
import { capitalizeFirst } from '../../utils/utils';

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: complex business logic
export const LicenseNotification = () => {
const licenses = useStore(useApiStore, (s) => s.licenses);
const licensesLoaded = useStore(useApiStore, (s) => s.licensesLoaded);
const licenseViolation = useStore(useApiStore, (s) => s.licenseViolation);
const enterpriseFeaturesUsed = useStore(useApiStore, (s) => s.enterpriseFeaturesUsed);
const licenses = useApiStoreHook((s) => s.licenses);
const licensesLoaded = useApiStoreHook((s) => s.licensesLoaded);
const licenseViolation = useApiStoreHook((s) => s.licenseViolation);
const enterpriseFeaturesUsed = useApiStoreHook((s) => s.enterpriseFeaturesUsed);
const location = useLocation();

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Alert, AlertDescription, AlertIcon, Box, Flex, Text } from '@redpanda-data/ui';
import { Link } from 'components/redpanda-ui/components/typography';
import { type FC, type ReactElement, useEffect, useState } from 'react';
import { useStore } from 'zustand';

import {
consoleHasEnterpriseFeature,
Expand All @@ -20,7 +19,7 @@ import {
} from './license-utils';
import { RegisterModal } from './register-modal';
import { type License, License_Type } from '../../protogen/redpanda/api/console/v1alpha1/license_pb';
import { api, useApiStore } from '../../state/backend-api';
import { api, useApiStoreHook } from '../../state/backend-api';

const getLicenseAlertContent = (
licenses: License[],
Expand Down Expand Up @@ -255,8 +254,8 @@ const getLicenseAlertContent = (
};

export const OverviewLicenseNotification: FC = () => {
const licenses = useStore(useApiStore, (s) => s.licenses);
const clusterOverview = useStore(useApiStore, (s) => s.clusterOverview);
const licenses = useApiStoreHook((s) => s.licenses);
const clusterOverview = useApiStoreHook((s) => s.clusterOverview);
const [registerModalOpen, setIsRegisterModalOpen] = useState(false);

useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/pages/acls/acl-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const UserActions = ({ user }: { user: UsersEntry }) => {

return (
<>
{Boolean(api.isAdminApiConfigured) && (
{Boolean(api.isAdminApiConfigured) && !isServerless() && (
<ChangePasswordModal
isOpen={isChangePasswordModalOpen}
setIsOpen={setIsChangePasswordModalOpen}
Expand All @@ -533,7 +533,7 @@ const UserActions = ({ user }: { user: UsersEntry }) => {
<Icon as={MoreHorizontalIcon} />
</MenuButton>
<MenuList>
{Boolean(api.isAdminApiConfigured) && (
{Boolean(api.isAdminApiConfigured) && !isServerless() && (
<MenuItem
onClick={(e) => {
e.stopPropagation();
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/pages/acls/user-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { UserAclsCard } from 'components/pages/roles/user-acls-card';
import { UserInformationCard } from 'components/pages/roles/user-information-card';
import { UserRolesCard } from 'components/pages/roles/user-roles-card';
import { Button } from 'components/redpanda-ui/components/button';
import { isServerless } from 'config';
import type { UpdateRoleMembershipResponse } from 'protogen/redpanda/api/console/v1alpha1/security_pb';
import { useEffect, useState } from 'react';

Expand Down Expand Up @@ -79,7 +80,7 @@ const UserDetailsPage = ({ userName }: UserDetailsPageProps) => {
<div className="flex flex-col gap-4">
<UserInformationCard
onEditPassword={
api.isAdminApiConfigured
api.isAdminApiConfigured && !isServerless()
? () => {
setIsChangePasswordModalOpen(true);
}
Expand Down Expand Up @@ -124,7 +125,7 @@ const UserDetailsPage = ({ userName }: UserDetailsPageProps) => {
)}
</div>

{Boolean(api.isAdminApiConfigured) && (
{Boolean(api.isAdminApiConfigured) && !isServerless() && (
<ChangePasswordModal
isOpen={isChangePasswordModalOpen}
setIsOpen={setIsChangePasswordModalOpen}
Expand Down
Loading