admin panel fast follows (#10723)
fast follows: - https://discord.com/channels/1130383047699738754/1346433965451382845 - https://discord.com/channels/1130383047699738754/1346434512757981264 - https://discord.com/channels/1130383047699738754/1346453484911853610 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -10,13 +10,13 @@ export const SettingsAdmin = () => {
|
||||
|
||||
return (
|
||||
<SubMenuTopBarContainer
|
||||
title={t`Server Admin`}
|
||||
title={t`Admin Panel`}
|
||||
links={[
|
||||
{
|
||||
children: t`Other`,
|
||||
href: getSettingsPath(SettingsPath.ServerAdmin),
|
||||
href: getSettingsPath(SettingsPath.AdminPanel),
|
||||
},
|
||||
{ children: t`Server Admin` },
|
||||
{ children: t`Admin Panel` },
|
||||
]}
|
||||
>
|
||||
<SettingsPageContainer>
|
||||
|
||||
@ -8,7 +8,7 @@ import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBa
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { H2Title, Section } from 'twenty-ui';
|
||||
import { H3Title, Section } from 'twenty-ui';
|
||||
import {
|
||||
AdminPanelHealthServiceStatus,
|
||||
HealthIndicatorId,
|
||||
@ -16,19 +16,24 @@ import {
|
||||
} from '~/generated/graphql';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
|
||||
const StyledH2Title = styled(H2Title)`
|
||||
const StyledH3Title = styled(H3Title)`
|
||||
margin-top: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
const StyledDescription = styled.div`
|
||||
color: ${({ theme }) => theme.font.color.tertiary};
|
||||
font-size: ${({ theme }) => theme.font.size.sm};
|
||||
font-weight: ${({ theme }) => theme.font.weight.regular};
|
||||
margin-top: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
const StyledTitleContainer = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: ${({ theme }) => theme.spacing(2)};
|
||||
gap: ${({ theme }) => theme.spacing(4)};
|
||||
`;
|
||||
|
||||
const StyledHealthStatusContainer = styled.div`
|
||||
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
||||
margin-top: ${({ theme }) => theme.spacing(1)};
|
||||
margin-top: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
export const SettingsAdminIndicatorHealthStatus = () => {
|
||||
@ -51,15 +56,15 @@ export const SettingsAdminIndicatorHealthStatus = () => {
|
||||
links={[
|
||||
{
|
||||
children: t`Other`,
|
||||
href: getSettingsPath(SettingsPath.ServerAdmin),
|
||||
href: getSettingsPath(SettingsPath.AdminPanel),
|
||||
},
|
||||
{
|
||||
children: t`Server Admin`,
|
||||
href: getSettingsPath(SettingsPath.ServerAdmin),
|
||||
children: t`Admin Panel`,
|
||||
href: getSettingsPath(SettingsPath.AdminPanel),
|
||||
},
|
||||
{
|
||||
children: t`Health Status`,
|
||||
href: getSettingsPath(SettingsPath.ServerAdminHealthStatus),
|
||||
href: getSettingsPath(SettingsPath.AdminPanelHealthStatus),
|
||||
},
|
||||
{ children: `${data?.getIndicatorHealthStatus?.label}` },
|
||||
]}
|
||||
@ -82,19 +87,20 @@ export const SettingsAdminIndicatorHealthStatus = () => {
|
||||
>
|
||||
<Section>
|
||||
<StyledTitleContainer>
|
||||
<StyledH2Title
|
||||
<StyledH3Title
|
||||
title={`${data?.getIndicatorHealthStatus?.label}`}
|
||||
description={data?.getIndicatorHealthStatus?.description}
|
||||
/>
|
||||
{indicatorId !== HealthIndicatorId.connectedAccount &&
|
||||
data?.getIndicatorHealthStatus?.status && (
|
||||
<StyledHealthStatusContainer>
|
||||
<SettingsAdminHealthStatusRightContainer
|
||||
status={data?.getIndicatorHealthStatus.status}
|
||||
/>
|
||||
</StyledHealthStatusContainer>
|
||||
)}
|
||||
{data?.getIndicatorHealthStatus?.status && (
|
||||
<StyledHealthStatusContainer>
|
||||
<SettingsAdminHealthStatusRightContainer
|
||||
status={data?.getIndicatorHealthStatus.status}
|
||||
/>
|
||||
</StyledHealthStatusContainer>
|
||||
)}
|
||||
</StyledTitleContainer>
|
||||
<StyledDescription>
|
||||
{data?.getIndicatorHealthStatus?.description}
|
||||
</StyledDescription>
|
||||
</Section>
|
||||
|
||||
<SettingsAdminIndicatorHealthStatusContent />
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
import { SettingsAdminEnvVariablesTable } from '@/settings/admin-panel/components/SettingsAdminEnvVariablesTable';
|
||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||
import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import styled from '@emotion/styled';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { H2Title, Section } from 'twenty-ui';
|
||||
import { useGetEnvironmentVariablesGroupedQuery } from '~/generated/graphql';
|
||||
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
|
||||
const StyledGroupContainer = styled.div`
|
||||
margin-bottom: ${({ theme }) => theme.spacing(6)};
|
||||
`;
|
||||
|
||||
export const SettingsAdminSecondaryEnvVariables = () => {
|
||||
const { data: environmentVariables, loading: environmentVariablesLoading } =
|
||||
useGetEnvironmentVariablesGroupedQuery({
|
||||
fetchPolicy: 'network-only',
|
||||
});
|
||||
|
||||
const hiddenGroups =
|
||||
environmentVariables?.getEnvironmentVariablesGrouped.groups.filter(
|
||||
(group) => group.isHiddenOnLoad,
|
||||
) ?? [];
|
||||
|
||||
if (environmentVariablesLoading) {
|
||||
return <SettingsSkeletonLoader />;
|
||||
}
|
||||
|
||||
return (
|
||||
<SubMenuTopBarContainer
|
||||
links={[
|
||||
{
|
||||
children: t`Other`,
|
||||
href: getSettingsPath(SettingsPath.AdminPanel),
|
||||
},
|
||||
{
|
||||
children: t`Admin Panel`,
|
||||
href: getSettingsPath(SettingsPath.AdminPanel),
|
||||
},
|
||||
{
|
||||
children: t`Other Environment Variables`,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<SettingsPageContainer>
|
||||
<Section>
|
||||
{hiddenGroups.map((group) => (
|
||||
<StyledGroupContainer key={group.name}>
|
||||
<H2Title title={group.name} description={group.description} />
|
||||
{group.variables.length > 0 && (
|
||||
<SettingsAdminEnvVariablesTable variables={group.variables} />
|
||||
)}
|
||||
</StyledGroupContainer>
|
||||
))}
|
||||
</Section>
|
||||
</SettingsPageContainer>
|
||||
</SubMenuTopBarContainer>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user