The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
feat: rename Releases settings page to Updates (#16634)
Thomas des Francs9a094d8a50d3
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsxindex 5725423a87b..28f2557a70d 100644--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx@@ -340,9 +340,9 @@ const SettingsAdminConfigVariableDetails = lazy(() =>})),);-const SettingsReleases = lazy(() =>- import('~/pages/settings/releases/SettingsReleases').then((module) => ({- default: module.SettingsReleases,+const SettingsUpdates = lazy(() =>+ import('~/pages/settings/updates/SettingsUpdates').then((module) => ({+ default: module.SettingsUpdates,})),);@@ -625,7 +625,7 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (/>}>- <Route path={SettingsPath.Releases} element={<SettingsReleases />} />+ <Route path={SettingsPath.Updates} element={<SettingsUpdates />} /></Route></Routes></Suspense>diff --git a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsxindex cb036f46148..f31b084dfd9 100644--- a/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx+++ b/packages/twenty-front/src/modules/settings/hooks/useSettingsNavigationItems.tsx@@ -202,8 +202,8 @@ const useSettingsNavigationItems = (): SettingsNavigationSection[] => {isHidden: !isAdminEnabled,},{- label: t`Releases`,- path: SettingsPath.Releases,+ label: t`Updates`,+ path: SettingsPath.Updates,Icon: IconRocket,isHidden: !permissionMap[PermissionFlagType.WORKSPACE],},diff --git a/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsx b/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsxdeleted file mode 100644index 56beaf9b6ab..00000000000--- a/packages/twenty-front/src/pages/settings/releases/SettingsReleases.tsx+++ /dev/null@@ -1,47 +0,0 @@-import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';-import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';-import { TabList } from '@/ui/layout/tab-list/components/TabList';-import { t } from '@lingui/core/macro';-import { SettingsPath } from 'twenty-shared/types';-import { getSettingsPath } from 'twenty-shared/utils';-import { IconFlask, IconRocket } from 'twenty-ui/display';--import { SettingsReleasesTabContent } from './components';-import { SETTINGS_RELEASES_TABS, SETTINGS_RELEASES_TABS_ID } from './constants';--export const SettingsReleases = () => {- const tabs = [- {- id: SETTINGS_RELEASES_TABS.CHANGELOG,- title: t`Changelog`,- Icon: IconRocket,- },- {- id: SETTINGS_RELEASES_TABS.LAB,- title: t`Lab`,- Icon: IconFlask,- },- ];-- return (- <SubMenuTopBarContainer- title={t`Releases`}- links={[- {- children: t`Other`,- href: getSettingsPath(SettingsPath.Releases),- },- { children: t`Releases` },- ]}- >- <SettingsPageContainer>- <TabList- tabs={tabs}- behaveAsLinks={false}- componentInstanceId={SETTINGS_RELEASES_TABS_ID}- />- <SettingsReleasesTabContent />- </SettingsPageContainer>- </SubMenuTopBarContainer>- );-};diff --git a/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesChangelogContent.tsx b/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesChangelogContent.tsxdeleted file mode 100644index 81dfa6c6053..00000000000--- a/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesChangelogContent.tsx+++ /dev/null@@ -1,117 +0,0 @@-import styled from '@emotion/styled';-import React, { useEffect, useState } from 'react';-import rehypeStringify from 'rehype-stringify';-import remarkParse from 'remark-parse';-import remarkRehype from 'remark-rehype';-import { type PluggableList, unified } from 'unified';-import { visit } from 'unist-util-visit';--import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';-import { formatToHumanReadableDate } from '~/utils/date-utils';--type ReleaseNote = {- slug: string;- date: string;- release: string;- content: string;- html: string;-};--const StyledReleaseContainer = styled.div`- img {- margin: ${({ theme }) => theme.spacing(6)} 0px 0px;- max-width: 100%;- }-- p img {- margin: 0px;- }-- h3 {- color: ${({ theme }) => theme.font.color.primary};- margin: ${({ theme }) => theme.spacing(6)} 0px 0px;- }- code {- background: ${({ theme }) => theme.background.tertiary};- padding: 4px;- border-radius: 4px;- }- p {- color: ${({ theme }) => theme.font.color.secondary};- font-family: Inter, sans-serif;- font-size: ${({ theme }) => theme.font.size.md};- line-height: 19.5px;- font-weight: ${({ theme }) => theme.font.weight.regular};- margin: ${({ theme }) => theme.spacing(6)} 0px 0px;- text-align: justify;- }-- li {- color: ${({ theme }) => theme.font.color.secondary};- }-- li strong {- color: ${({ theme }) => theme.font.color.primary};- }-`;--const StyledReleaseHeader = styled.h2`- color: ${({ theme }) => theme.font.color.primary};- font-weight: ${({ theme }) => theme.font.weight.medium};- line-height: 18px;- font-size: ${({ theme }) => theme.font.size.md};- margin: 0;- margin-top: ${({ theme }) => theme.spacing(10)};-- &:first-of-type {- margin-top: 0;- }-`;--const StyledReleaseDate = styled.span`- font-weight: ${({ theme }) => theme.font.weight.regular};- font-size: 12px;- line-height: 18px;- color: ${({ theme }) => theme.font.color.tertiary};-`;--export const SettingsReleasesChangelogContent = () => {- const [releases, setReleases] = useState<ReleaseNote[]>([]);-- useEffect(() => {- fetch('https://twenty.com/api/releases').then(async (res) => {- const json = await res.json();- for (const release of json) {- release.html = String(- await unified()- .use([remarkParse, remarkRehype, rehypeStringify] as PluggableList)- .use(() => (tree: any) => {- visit(tree, (node) => {- if (node.tagName === 'h1' || node.tagName === 'h2') {- node.tagName = 'h3';- }- });- })- .process(release.content),- );- }- setReleases(json);- });- }, []);-- return (- <ScrollWrapper componentInstanceId="scroll-wrapper-releases">- <StyledReleaseContainer>- {releases.map((release) => (- <React.Fragment key={release.slug}>- <StyledReleaseHeader>{release.release}</StyledReleaseHeader>- <StyledReleaseDate>- {formatToHumanReadableDate(release.date)}- </StyledReleaseDate>- <div dangerouslySetInnerHTML={{ __html: release.html }}></div>- </React.Fragment>- ))}- </StyledReleaseContainer>- </ScrollWrapper>- );-};diff --git a/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesTabContent.tsx b/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesTabContent.tsxdeleted file mode 100644index 7ce6e1fc8c3..00000000000--- a/packages/twenty-front/src/pages/settings/releases/components/SettingsReleasesTabContent.tsx+++ /dev/null@@ -1,24 +0,0 @@-import { SettingsLabContent } from '@/settings/lab/components/SettingsLabContent';-import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';-import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';-import {- SETTINGS_RELEASES_TABS,- SETTINGS_RELEASES_TABS_ID,-} from '../constants';-import { SettingsReleasesChangelogContent } from './SettingsReleasesChangelogContent';--export const SettingsReleasesTabContent = () => {- const activeTabId = useRecoilComponentValue(- activeTabIdComponentState,- SETTINGS_RELEASES_TABS_ID,- );-- switch (activeTabId) {- case SETTINGS_RELEASES_TABS.CHANGELOG:- return <SettingsReleasesChangelogContent />;- case SETTINGS_RELEASES_TABS.LAB:- return <SettingsLabContent />;- default:- return <SettingsReleasesChangelogContent />;- }-};diff --git a/packages/twenty-front/src/pages/settings/releases/components/index.ts b/packages/twenty-front/src/pages/settings/releases/components/index.tsdeleted file mode 100644index c5644b31ecc..00000000000--- a/packages/twenty-front/src/pages/settings/releases/components/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { SettingsReleasesChangelogContent } from './SettingsReleasesChangelogContent';-export { SettingsReleasesTabContent } from './SettingsReleasesTabContent';diff --git a/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabs.ts b/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabs.tsdeleted file mode 100644index 10a877fa627..00000000000--- a/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabs.ts+++ /dev/null@@ -1,4 +0,0 @@-export const SETTINGS_RELEASES_TABS = {- CHANGELOG: 'changelog',- LAB: 'lab',-};diff --git a/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabsId.ts b/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabsId.tsdeleted file mode 100644index 2cd50b2c81c..00000000000--- a/packages/twenty-front/src/pages/settings/releases/constants/SettingsReleasesTabsId.ts+++ /dev/null@@ -1 +0,0 @@-export const SETTINGS_RELEASES_TABS_ID = 'settings-releases-tabs';diff --git a/packages/twenty-front/src/pages/settings/releases/constants/index.ts b/packages/twenty-front/src/pages/settings/releases/constants/index.tsdeleted file mode 100644index e03e3fecec4..00000000000--- a/packages/twenty-front/src/pages/settings/releases/constants/index.ts+++ /dev/null@@ -1,2 +0,0 @@-export { SETTINGS_RELEASES_TABS } from './SettingsReleasesTabs';-export { SETTINGS_RELEASES_TABS_ID } from './SettingsReleasesTabsId';diff --git a/packages/twenty-front/src/pages/settings/releases/index.ts b/packages/twenty-front/src/pages/settings/releases/index.tsdeleted file mode 100644index 75f0132c830..00000000000--- a/packages/twenty-front/src/pages/settings/releases/index.ts+++ /dev/null@@ -1 +0,0 @@-export { SettingsReleases } from './SettingsReleases';diff --git a/packages/twenty-front/src/pages/settings/updates/SettingsUpdates.tsx b/packages/twenty-front/src/pages/settings/updates/SettingsUpdates.tsxnew file mode 100644index 00000000000..9453024d502--- /dev/null+++ b/packages/twenty-front/src/pages/settings/updates/SettingsUpdates.tsx@@ -0,0 +1,64 @@+import { SettingsCard } from '@/settings/components/SettingsCard';+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';+import { SettingsLabContent } from '@/settings/lab/components/SettingsLabContent';+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';+import { useTheme } from '@emotion/react';+import styled from '@emotion/styled';+import { t } from '@lingui/core/macro';+import { SettingsPath } from 'twenty-shared/types';+import { getSettingsPath } from 'twenty-shared/utils';+import { H2Title, IconTransform } from 'twenty-ui/display';+import { Section } from 'twenty-ui/layout';++const StyledCardLink = styled.a`+ text-decoration: none;+`;++export const SettingsUpdates = () => {+ const theme = useTheme();++ return (+ <SubMenuTopBarContainer+ title={t`Updates`}+ links={[+ {+ children: t`Other`,+ href: getSettingsPath(SettingsPath.Updates),+ },+ { children: t`Updates` },+ ]}+ >+ <SettingsPageContainer>+ <Section>+ <H2Title+ title={t`Releases`}+ description={t`Check out our latest releases`}+ />+ <StyledCardLink+ href="https://twenty.com/releases"+ target="_blank"+ rel="noopener noreferrer"+ >+ <SettingsCard+ Icon={+ <IconTransform+ size={theme.icon.size.md}+ stroke={theme.icon.stroke.sm}+ />+ }+ title={t`Read changelog`}+ />+ </StyledCardLink>+ </Section>++ <Section>+ <H2Title+ title={t`Early access`}+ description={t`Try our upcoming features. Note they are still in beta. Please bear with us and report any issues you find.`}+ />+ <SettingsLabContent />+ </Section>+ </SettingsPageContainer>+ </SubMenuTopBarContainer>+ );+};diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.tsindex fbdc70aba7d..68bb8aec344 100644--- a/packages/twenty-shared/src/types/SettingsPath.ts+++ b/packages/twenty-shared/src/types/SettingsPath.ts@@ -26,7 +26,7 @@ export enum SettingsPath {NewApprovedAccessDomain = 'domains/approved-access-domain/new',NewEmailingDomain = 'domains/emailing-domain/new',EmailingDomainDetail = 'domains/emailing-domain/:domainId',- Releases = 'releases',+ Updates = 'updates',AI = 'ai',AINewAgent = 'ai/new-agent',AIAgentDetail = 'ai/agents/:agentId',diff --git a/packages/twenty-ui/src/display/icon/components/TablerIcons.ts b/packages/twenty-ui/src/display/icon/components/TablerIcons.tsindex e7574581710..520633a8cd6 100644--- a/packages/twenty-ui/src/display/icon/components/TablerIcons.ts+++ b/packages/twenty-ui/src/display/icon/components/TablerIcons.ts@@ -357,6 +357,7 @@ export {IconTimeDuration60,IconTimelineEvent,IconTool,+ IconTransform,IconTrash,IconTrashOff,IconTrashX,diff --git a/packages/twenty-ui/src/display/index.ts b/packages/twenty-ui/src/display/index.tsindex 5fa83cd63c0..713bdd57a03 100644--- a/packages/twenty-ui/src/display/index.ts+++ b/packages/twenty-ui/src/display/index.ts@@ -422,6 +422,7 @@ export {IconTimeDuration60,IconTimelineEvent,IconTool,+ IconTransform,IconTrash,IconTrashOff,IconTrashX,