Skip to content

The open alternative to Salesforce, designed for AI.

Fix dark mode text color on permissions tab empty stat (#19336) (#19340)

Neil Kanakiabad488494f4e
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
index a500c1237c0..2cdac7087e9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { SettingsAdminDeleteJobsConfirmationModal } from '@/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal';
import { SettingsAdminJobDetailsExpandable } from '@/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable';
import { SettingsAdminJobStateBadge } from '@/settings/admin-panel/health-status/components/SettingsAdminJobStateBadge';
@@ -49,12 +50,6 @@ const StyledControlsContainer = styled.div`
justify-content: space-between;
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[8]};
- text-align: center;
-`;
-
const StyledPaginationContainer = styled.div`
align-items: center;
display: flex;
@@ -261,9 +256,9 @@ export const SettingsAdminQueueJobsTable = ({
</StyledControlsContainer>
{loading && jobs.length === 0 ? (
- <StyledEmptyState>{t`Loading jobs...`}</StyledEmptyState>
+ <SettingsEmptyPlaceholder>{t`Loading jobs...`}</SettingsEmptyPlaceholder>
) : jobs.length === 0 ? (
- <StyledEmptyState>{t`No jobs found`}</StyledEmptyState>
+ <SettingsEmptyPlaceholder>{t`No jobs found`}</SettingsEmptyPlaceholder>
) : (
<>
<Table>
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsEmptyPlaceholder.tsx b/packages/twenty-front/src/modules/settings/components/SettingsEmptyPlaceholder.tsx
new file mode 100644
index 00000000000..9680154abce
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/components/SettingsEmptyPlaceholder.tsx
@@ -0,0 +1,35 @@
+import { styled } from '@linaria/react';
+import { type ReactNode } from 'react';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+type ThemeSpacingKey = keyof typeof themeCssVariables.spacing;
+
+type SettingsEmptyPlaceholderProps = {
+ children: ReactNode;
+ padding?: ThemeSpacingKey;
+ textAlign?: 'left' | 'center' | 'right';
+};
+
+const StyledPlaceholder = styled.div<{
+ placeholderPadding: string;
+ placeholderTextAlign: string;
+}>`
+ color: ${themeCssVariables.font.color.tertiary};
+ padding: ${({ placeholderPadding }) => placeholderPadding};
+ text-align: ${({ placeholderTextAlign }) => placeholderTextAlign};
+`;
+
+export const SettingsEmptyPlaceholder = ({
+ children,
+ padding = '8',
+ textAlign = 'center',
+}: SettingsEmptyPlaceholderProps) => {
+ return (
+ <StyledPlaceholder
+ placeholderPadding={themeCssVariables.spacing[padding]}
+ placeholderTextAlign={textAlign}
+ >
+ {children}
+ </StyledPlaceholder>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentEntityPickerDropdown.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentEntityPickerDropdown.tsx
index ad02dcb9ebc..e3270b79581 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentEntityPickerDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentEntityPickerDropdown.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
@@ -35,12 +36,6 @@ const StyledItemName = styled.div`
font-weight: ${themeCssVariables.font.weight.medium};
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[2]};
- text-align: center;
-`;
-
type EntityData = Agent | ApiKeyForRole;
type SettingsRoleAssignmentEntityPickerDropdownProps = {
@@ -138,7 +133,9 @@ export const SettingsRoleAssignmentEntityPickerDropdown = ({
</StyledDropdownItem>
))
) : (
- <StyledEmptyState>{getEmptyStateMessage()}</StyledEmptyState>
+ <SettingsEmptyPlaceholder padding="2">
+ {getEmptyStateMessage()}
+ </SettingsEmptyPlaceholder>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolParameterTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolParameterTable.tsx
index a6cfda0c427..c606dd3e4e8 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolParameterTable.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolParameterTable.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { type ComponentType, useContext } from 'react';
@@ -89,7 +90,9 @@ export const SettingsToolParameterTable = ({
const entries = Object.entries(schemaProperties);
if (entries.length === 0 && !functionLink) {
- return <div>{t`No parameters`}</div>;
+ return (
+ <SettingsEmptyPlaceholder>{t`No parameters`}</SettingsEmptyPlaceholder>
+ );
}
return (
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx
index 7f97091399b..14cc4cacb17 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationDataTable.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { SETTINGS_OBJECT_TABLE_COLUMN_WIDTH } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents';
import { Table } from '@/ui/layout/table/components/Table';
import { TableHeader } from '@/ui/layout/table/components/TableHeader';
@@ -39,12 +40,6 @@ const StyledSearchInputContainer = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[8]};
- text-align: center;
-`;
-
export const SettingsApplicationDataTable = ({
objectRows,
fieldGroupRows,
@@ -102,7 +97,7 @@ export const SettingsApplicationDataTable = ({
/>
</StyledSearchInputContainer>
{hasNoResults ? (
- <StyledEmptyState>{t`No object found`}</StyledEmptyState>
+ <SettingsEmptyPlaceholder>{t`No object found`}</SettingsEmptyPlaceholder>
) : (
<Table>
<TableRow gridAutoColumns={MAIN_ROW_GRID_COLUMNS}>
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationPermissionsTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationPermissionsTab.tsx
index 68855d7297f..6b3c92cdd92 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationPermissionsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationPermissionsTab.tsx
@@ -5,6 +5,7 @@ import { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRo
import { SettingsRolePermissions } from '@/settings/roles/role-permissions/components/SettingsRolePermissions';
import { settingsDraftRoleFamilyState } from '@/settings/roles/states/settingsDraftRoleFamilyState';
import { type RoleWithPartialMembers } from '@/settings/roles/types/RoleWithPartialMembers';
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { useSetAtomFamilyState } from '@/ui/utilities/state/jotai/hooks/useSetAtomFamilyState';
import { t } from '@lingui/core/macro';
import { useCallback, useEffect, useMemo, useState } from 'react';
@@ -393,5 +394,9 @@ export const SettingsApplicationPermissionsTab = ({
);
}
- return <div>{t`No permissions configured for this application.`}</div>;
+ return (
+ <SettingsEmptyPlaceholder padding="0">
+ {t`No permissions configured for this application.`}
+ </SettingsEmptyPlaceholder>
+ );
};
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsAvailableTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsAvailableTab.tsx
index ede140c6102..d2b3187aceb 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsAvailableTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsAvailableTab.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -26,12 +27,6 @@ const StyledCardsGrid = styled.div`
}
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[4]};
- text-align: center;
-`;
-
const StyledHintLink = styled.button`
background: none;
border: none;
@@ -73,7 +68,7 @@ export const SettingsApplicationsAvailableTab = () => {
if (isLoading) {
return (
<Section>
- <StyledEmptyState>{t`Loading applications...`}</StyledEmptyState>
+ <SettingsEmptyPlaceholder padding="4">{t`Loading applications...`}</SettingsEmptyPlaceholder>
</Section>
);
}
@@ -115,7 +110,7 @@ export const SettingsApplicationsAvailableTab = () => {
</StyledSearchInputContainer>
{filteredApplications.length === 0 ? (
- <StyledEmptyState>
+ <SettingsEmptyPlaceholder padding="4">
{showNonFeaturedHint
? t`No featured applications found. ${nonFeaturedCount} non-featured result(s) available — `
: t`No applications available`}
@@ -124,7 +119,7 @@ export const SettingsApplicationsAvailableTab = () => {
{t`show all`}
</StyledHintLink>
)}
- </StyledEmptyState>
+ </SettingsEmptyPlaceholder>
) : (
<StyledCardsGrid>
{filteredApplications.map((application) => (
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx
index 763c5bea551..e7a8c04f021 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsDeveloperTab.tsx
@@ -1,4 +1,5 @@
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { SettingsListCard } from '@/settings/components/SettingsListCard';
import {
StyledActionTableCell,
@@ -50,12 +51,6 @@ const StyledSearchInputContainer = styled.div`
padding-bottom: ${themeCssVariables.spacing[2]};
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[8]};
- text-align: center;
-`;
-
const StyledTableRowsContainer = styled.div`
border-bottom: 1px solid ${themeCssVariables.border.color.light};
padding: ${themeCssVariables.spacing[2]} 0;
@@ -235,7 +230,7 @@ export const SettingsApplicationsDeveloperTab = () => {
/>
</StyledSearchInputContainer>
{filteredMarketplaceApps.length === 0 ? (
- <StyledEmptyState>{t`No application found`}</StyledEmptyState>
+ <SettingsEmptyPlaceholder>{t`No application found`}</SettingsEmptyPlaceholder>
) : (
<Table>
<TableRow gridAutoColumns={NPM_PACKAGES_GRID_COLUMNS}>
diff --git a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
index 879d6d31116..6914b0632e0 100644
--- a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsEmailingDomainVerificationRecords } from '@/settings/emailing-domains/components/SettingsEmailingDomainVerificationRecords';
@@ -26,11 +27,15 @@ export const SettingsEmailingDomainDetail = () => {
);
if (loading) {
- return <div>{t`Loading...`}</div>;
+ return <SettingsEmptyPlaceholder>{t`Loading...`}</SettingsEmptyPlaceholder>;
}
if (isDefined(error) || !isDefined(emailingDomain)) {
- return <Trans>Domain not found</Trans>;
+ return (
+ <SettingsEmptyPlaceholder>
+ <Trans>Domain not found</Trans>
+ </SettingsEmptyPlaceholder>
+ );
}
return (
diff --git a/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx b/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx
index 7fc35e3faba..ef9638287fb 100644
--- a/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx
+++ b/packages/twenty-front/src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx
@@ -1,3 +1,4 @@
+import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { styled } from '@linaria/react';
import { msg } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
@@ -132,12 +133,6 @@ const StyledResizeHandle = styled.div<{ isResizing: boolean }>`
}
`;
-const StyledEmptyState = styled.div`
- color: ${themeCssVariables.font.color.tertiary};
- padding: ${themeCssVariables.spacing[8]};
- text-align: center;
-`;
-
const StyledLoadingMore = styled.div`
color: ${themeCssVariables.font.color.tertiary};
padding: ${themeCssVariables.spacing[4]};
@@ -292,9 +287,9 @@ export const EventLogResultsTable = ({
if (!loading && records.length === 0) {
return (
- <StyledEmptyState>
+ <SettingsEmptyPlaceholder>
<Trans>No event logs found</Trans>
- </StyledEmptyState>
+ </SettingsEmptyPlaceholder>
);
}