Skip to content

Commit

Permalink
conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamsundertard committed Oct 16, 2024
2 parents 36dbf92 + 8e86e94 commit 190c10f
Show file tree
Hide file tree
Showing 75 changed files with 864 additions and 487 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Front / Build storybook
run: npx nx storybook:build twenty-front
front-sb-test:
runs-on: ci-8-cores
runs-on: shipfox-8vcpu-ubuntu-2204
needs: front-sb-build
strategy:
matrix:
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Run storybook tests
run: npx nx storybook:serve-and-test:static twenty-front --configuration=${{ matrix.storybook_scope }}
front-sb-test-performance:
runs-on: ci-8-cores
runs-on: shipfox-8vcpu-ubuntu-2204
env:
REACT_APP_SERVER_BASE_URL: http://localhost:3000
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
Expand Down
36 changes: 11 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
docker-dev-build:
make -C packages/twenty-docker dev-build

docker-dev-up:
make -C packages/twenty-docker dev-up

docker-dev-start:
make -C packages/twenty-docker dev-start

docker-dev-stop:
make -C packages/twenty-docker dev-stop

docker-dev-sh:
make -C packages/twenty-docker dev-sh

postgres-on-docker:
make -C packages/twenty-postgres provision-on-docker

postgres-on-macos-arm:
make -C packages/twenty-postgres provision-on-macos-arm

postgres-on-macos-intel:
make -C packages/twenty-postgres provision-on-macos-intel

postgres-on-linux:
make -C packages/twenty-postgres provision-on-linux
docker run \
--name twenty_postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=default \
-v twenty_db_data:/var/lib/postgresql/data \
-p 5432:5432 \
twentycrm/twenty-postgres:latest

redis-on-docker:
docker run -d --name twenty_redis -p 6379:6379 redis/redis-stack-server:latest
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ Your turn 👇
» 12-October-2024 by [Ionfinisher](https://oss.gg/Ionfinisher) poster Link: [poster](https://x.com/ion_finisher/status/1845168965963628802)

» 14-October-2024 by [AliYar-Khan](https://oss.gg/AliYar-Khan) poster Link: [poster](https://x.com/Mr_Programmer14/status/1845888855183884352)

» 16-October-2024 by [Harsh BHat](https://oss.gg/harshsbhat) poster Link: [poster](https://x.com/HarshBhatX/status/1846233330435477531)
---
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Your turn 👇

» 13-October-2024 by [Ionfinisher](https://oss.gg/Ionfinisher) Logo Link: [logo](https://drive.google.com/file/d/1l9vE8CIjW9KfdioI5WKzxrdmvO8LR4j7/view?usp=drive_link) » tweet Link: [tweet](https://x.com/ion_finisher/status/1845466470429442163)

» 16-October-2024 by [harshsbhat](https://oss.gg/harshsbhat) Logo Link: [logo](https://drive.google.com/file/d/1jmqwNvlSyWSY1-pCG63TAtDvCoVa8xg-/view?usp=sharing) » tweet Link: [tweet](https://x.com/HarshBhatX/status/1846234658712772977)

---
3 changes: 3 additions & 0 deletions oss-gg/twenty-side-quest/1-quote-tweet-20-oss-gg-launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ Your turn 👇

» 13-October-2024 by Yash Parmar
» Link to Tweet: https://x.com/yashp3020/status/1845720834716959009

» 16-October-2024 by Harsh Bhat
» Link to Tweet: https://x.com/HarshBhatX/status/1846252536241508392
3 changes: 3 additions & 0 deletions oss-gg/twenty-side-quest/2-tweet-about-fav-twenty-feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ Your turn 👇

» 13-October-2024 by Ali Yar Khan
» Link to Tweet: https://x.com/Mr_Programmer14/status/1845530448245711197

» 16-October-2024 by Harsh Bhat
» Link to Tweet: https://x.com/HarshBhatX/status/1846075312691413066
---
3 changes: 3 additions & 0 deletions oss-gg/twenty-side-quest/4-meme-magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ Your turn 👇

» 14-October-2024 by Yash Parmar
» Link to Tweet: [https://x.com/yashp3020/status/1845108226527994222](https://x.com/yashp3020/status/1845720142702842093)

» 16-October-2024 by Harsh Bhat
» Link to Tweet: https://x.com/HarshBhatX/status/1844698253104709899
---
4 changes: 4 additions & 0 deletions oss-gg/twenty-side-quest/5-gif-magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,9 @@ Your turn 👇
» 13-October-2024 by Nabhag Motivaras
» Link to gif: https://giphy.com/gifs/twenty-twentycrm-opensourcecrm-wCcsmnJuzzzGrfuf9B

» 15-October-2024 by Ali Yar Khan
» Link to gif: https://giphy.com/gifs/Q3f7T107wSsMJlT7aj

» 16-October-2024 by Harsh Bhat
» Link to gif: https://giphy.com/gifs/oss-twentycrm-mgoYSDrjIalUL7XJzm
---
3 changes: 1 addition & 2 deletions packages/twenty-docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ TAG=latest
# POSTGRES_ADMIN_PASSWORD=replace_me_with_a_strong_password

PG_DATABASE_HOST=db:5432
REDIS_URL=redis://redis:6379

SERVER_URL=http://localhost:3000
# REDIS_HOST=redis
# REDIS_PORT=6379

# Use openssl rand -base64 32 for each secret
# ACCESS_TOKEN_SECRET=replace_me_with_a_random_string_access
Expand Down
6 changes: 2 additions & 4 deletions packages/twenty-docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ services:
PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default
SERVER_URL: ${SERVER_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_URL: ${REDIS_URL:-redis://localhost:6379}

ENABLE_DB_MIGRATIONS: "true"

Expand Down Expand Up @@ -59,8 +58,7 @@ services:
PG_DATABASE_URL: postgres://twenty:twenty@${PG_DATABASE_HOST}/default
SERVER_URL: ${SERVER_URL}
FRONT_BASE_URL: ${FRONT_BASE_URL:-$SERVER_URL}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_URL: ${REDIS_URL:-redis://localhost:6379}

ENABLE_DB_MIGRATIONS: "false" # it already runs on the server

Expand Down
6 changes: 2 additions & 4 deletions packages/twenty-docker/k8s/manifests/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ spec:
value: "https://crm.example.com:443"
- name: "PG_DATABASE_URL"
value: "postgres://twenty:[email protected]/default"
- name: "REDIS_HOST"
value: "twentycrm-redis.twentycrm.svc.cluster.local"
- name: "REDIS_PORT"
value: 6379
- name: "REDIS_URL"
value: "redis://twentycrm-redis.twentycrm.svc.cluster.local:6379"
- name: ENABLE_DB_MIGRATIONS
value: "true"
- name: SIGN_IN_PREFILLED
Expand Down
6 changes: 2 additions & 4 deletions packages/twenty-docker/k8s/manifests/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ spec:
value: "bull-mq"
- name: "CACHE_STORAGE_TYPE"
value: "redis"
- name: "REDIS_HOST"
value: "twentycrm-redis.twentycrm.svc.cluster.local"
- name: "REDIS_PORT"
value: 6379
- name: "REDIS_URL"
value: "redis://twentycrm-redis.twentycrm.svc.cluster.local:6379"
- name: ACCESS_TOKEN_SECRET
valueFrom:
secretKeyRef:
Expand Down
8 changes: 2 additions & 6 deletions packages/twenty-docker/k8s/terraform/deployment-server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ resource "kubernetes_deployment" "twentycrm_server" {
value = "postgres://twenty:${var.twentycrm_pgdb_admin_password}@${kubernetes_service.twentycrm_db.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local/default"
}
env {
name = "REDIS_HOST"
value = "${kubernetes_service.twentycrm_redis.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local"
}
env {
name = "REDIS_PORT"
value = 6379
name = "REDIS_URL"
value = "redis://${kubernetes_service.twentycrm_redis.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local:6379"
}
env {
name = "ENABLE_DB_MIGRATIONS"
Expand Down
9 changes: 2 additions & 7 deletions packages/twenty-docker/k8s/terraform/deployment-worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ resource "kubernetes_deployment" "twentycrm_worker" {
}

env {
name = "REDIS_HOST"
value = "${kubernetes_service.twentycrm_redis.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local"
}

env {
name = "REDIS_PORT"
value = 6379
name = "REDIS_URL"
value = "redis://${kubernetes_service.twentycrm_redis.metadata.0.name}.${kubernetes_namespace.twentycrm.metadata.0.name}.svc.cluster.local:6379"
}

env {
Expand Down
29 changes: 29 additions & 0 deletions packages/twenty-docker/twenty-website/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:18.17.1-alpine as twenty-website-build


WORKDIR /app

COPY ./package.json .
COPY ./yarn.lock .
COPY ./.yarnrc.yml .
COPY ./.yarn/releases /app/.yarn/releases
COPY ./tools/eslint-rules /app/tools/eslint-rules
COPY ./packages/twenty-website/package.json /app/packages/twenty-website/package.json

RUN yarn

COPY ./packages/twenty-website /app/packages/twenty-website
RUN npx nx build twenty-website

FROM node:18.17.1-alpine as twenty-website

WORKDIR /app/packages/twenty-website

COPY --from=twenty-website-build /app /app

WORKDIR /app/packages/twenty-website

LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
LABEL org.opencontainers.image.description="This image provides a consistent and reproducible environment for the website."

CMD ["/bin/sh", "-c", "npx nx start"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useContext, useRef } from 'react';
import { useRecoilCallback, useRecoilValue } from 'recoil';
import { Key } from 'ts-key-enum';

import { RecordBoardHeader } from '@/object-record/record-board/components/RecordBoardHeader';
import { RecordBoardStickyHeaderEffect } from '@/object-record/record-board/components/RecordBoardStickyHeaderEffect';
import { RecordBoardContext } from '@/object-record/record-board/contexts/RecordBoardContext';
import { useRecordBoardStates } from '@/object-record/record-board/hooks/internal/useRecordBoardStates';
import { useRecordBoardSelection } from '@/object-record/record-board/hooks/useRecordBoardSelection';
Expand All @@ -19,40 +21,35 @@ import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/get
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { useScrollRestoration } from '~/hooks/useScrollRestoration';

export type RecordBoardProps = {
recordBoardId: string;
};

const StyledContainer = styled.div`
border-top: 1px solid ${({ theme }) => theme.border.color.light};
overflow: auto;
display: flex;
flex: 1;
flex-direction: row;
min-height: calc(100% - 1px);
height: 100%;
`;

const StyledWrapper = styled.div`
const StyledColumnContainer = styled.div`
display: flex;
`;

const StyledContainerContainer = styled.div`
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
position: relative;
width: 100%;
`;

const StyledBoardHeader = styled.div`
position: relative;
z-index: 1;
const StyledBoardContentContainer = styled.div`
display: flex;
flex-direction: column;
`;

const RecordBoardScrollRestoreEffect = () => {
useScrollRestoration();
return null;
};

export const RecordBoard = ({ recordBoardId }: RecordBoardProps) => {
const { updateOneRecord, selectFieldMetadataItem } =
export const RecordBoard = () => {
const { updateOneRecord, selectFieldMetadataItem, recordBoardId } =
useContext(RecordBoardContext);
const boardRef = useRef<HTMLDivElement>(null);

Expand All @@ -75,7 +72,7 @@ export const RecordBoard = ({ recordBoardId }: RecordBoardProps) => {

useScopedHotkeys([Key.Escape], resetRecordSelection, TableHotkeyScope.Table);

const onDragEnd: OnDragEndResponder = useRecoilCallback(
const handleDragEnd: OnDragEndResponder = useRecoilCallback(
({ snapshot }) =>
(result) => {
if (!result.destination) return;
Expand Down Expand Up @@ -146,27 +143,32 @@ export const RecordBoard = ({ recordBoardId }: RecordBoardProps) => {
onColumnsChange={() => {}}
onFieldsChange={() => {}}
>
<StyledWrapper>
<StyledBoardHeader />
<ScrollWrapper contextProviderName="recordBoard">
<StyledContainer ref={boardRef}>
<DragDropContext onDragEnd={onDragEnd}>
{columnIds.map((columnId) => (
<RecordBoardColumn
key={columnId}
recordBoardColumnId={columnId}
/>
))}
</DragDropContext>
</StyledContainer>
<RecordBoardScrollRestoreEffect />
</ScrollWrapper>
<DragSelect
dragSelectable={boardRef}
onDragSelectionStart={resetRecordSelection}
onDragSelectionChange={setRecordAsSelected}
/>
</StyledWrapper>
<ScrollWrapper contextProviderName="recordBoard">
<RecordBoardStickyHeaderEffect />
<StyledContainerContainer>
<RecordBoardHeader />
<StyledBoardContentContainer>
<StyledContainer ref={boardRef}>
<DragDropContext onDragEnd={handleDragEnd}>
<StyledColumnContainer>
{columnIds.map((columnId) => (
<RecordBoardColumn
key={columnId}
recordBoardColumnId={columnId}
/>
))}
</StyledColumnContainer>
</DragDropContext>
</StyledContainer>
<RecordBoardScrollRestoreEffect />
<DragSelect
dragSelectable={boardRef}
onDragSelectionStart={resetRecordSelection}
onDragSelectionChange={setRecordAsSelected}
/>
</StyledBoardContentContainer>
</StyledContainerContainer>
</ScrollWrapper>
</RecordBoardScope>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useRecoilValue } from 'recoil';

import { useRecordBoardStates } from '@/object-record/record-board/hooks/internal/useRecordBoardStates';
import { RecordBoardColumnHeaderWrapper } from '@/object-record/record-board/record-board-column/components/RecordBoardColumnHeaderWrapper';
import styled from '@emotion/styled';

const StyledHeaderContainer = styled.div`
display: flex;
flex-direction: row;
height: 40px;
z-index: 10;
overflow: visible;
width: 100%;
&.header-sticky {
position: sticky;
top: 0;
}
`;

export const RecordBoardHeader = () => {
const { columnIdsState } = useRecordBoardStates();

const columnIds = useRecoilValue(columnIdsState);

return (
<StyledHeaderContainer id="record-board-header">
{columnIds.map((columnId) => (
<RecordBoardColumnHeaderWrapper columnId={columnId} />
))}
</StyledHeaderContainer>
);
};
Loading

0 comments on commit 190c10f

Please sign in to comment.