addressing:
https://github.com/twentyhq/twenty/issues/11997#issuecomment-2875772322
<img width="922" alt="Screenshot 2025-05-13 at 22 52 28"
src="https://github.com/user-attachments/assets/dc3b5fdd-b81b-4732-94f3-2ef2eb0012c2"
/>
before:
https://github.com/user-attachments/assets/b55bf77e-99bf-485f-bcfa-5d311e7d2bd0
after:
https://github.com/user-attachments/assets/70fb80b2-ce9f-4a8a-ac5d-d8c793c023be
### Some other issues I found
- On clicking clear, nothing happens
Before:
https://github.com/user-attachments/assets/01e937bb-b4d4-4296-baa7-ec1602de2cc9
After:
https://github.com/user-attachments/assets/8e4e5022-fe32-44fe-a7e4-5c98a7f3c2fa
- same behaviour for inline cell DateInput:
https://github.com/user-attachments/assets/787354e5-b50a-457c-a392-4779270e2832
### Notes
The root issue seems to be that ViewBarFilterDropdown sets a fixed width
of 208px, which isn’t enough for the calendar to render correctly - it
ends up cropping the content. The fix here is more of a workaround than
a deep fix: I’ve adjusted styles to avoid the cropping, but it might be
worth revisiting how we handle sizing for filter dropdowns in general.
cc @lucasbordeau - thoughts?
Related commit:
afea017c12
---------
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
151 lines
5.9 KiB
YAML
151 lines
5.9 KiB
YAML
name: 'Preview Environment Keep Alive'
|
|
|
|
on:
|
|
repository_dispatch:
|
|
types: [preview-environment]
|
|
|
|
jobs:
|
|
preview-environment:
|
|
timeout-minutes: 310
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout PR
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.client_payload.pr_head_sha }}
|
|
|
|
- name: Run compose setup
|
|
run: |
|
|
echo "Patching docker-compose.yml..."
|
|
# change image to localbuild using yq
|
|
yq eval 'del(.services.server.image)' -i packages/twenty-docker/docker-compose.yml
|
|
yq eval '.services.server.build.context = "../../"' -i packages/twenty-docker/docker-compose.yml
|
|
yq eval '.services.server.build.dockerfile = "./packages/twenty-docker/twenty/Dockerfile"' -i packages/twenty-docker/docker-compose.yml
|
|
|
|
yq eval 'del(.services.worker.image)' -i packages/twenty-docker/docker-compose.yml
|
|
yq eval '.services.worker.build.context = "../../"' -i packages/twenty-docker/docker-compose.yml
|
|
yq eval '.services.worker.build.dockerfile = "./packages/twenty-docker/twenty/Dockerfile"' -i packages/twenty-docker/docker-compose.yml
|
|
|
|
echo "Setting up .env file..."
|
|
cp packages/twenty-docker/.env.example packages/twenty-docker/.env
|
|
|
|
echo "Generating secrets..."
|
|
echo "# === Randomly generated secrets ===" >> packages/twenty-docker/.env
|
|
echo "APP_SECRET=$(openssl rand -base64 32)" >> packages/twenty-docker/.env
|
|
echo "PG_DATABASE_PASSWORD=$(openssl rand -hex 16)" >> packages/twenty-docker/.env
|
|
echo "SIGN_IN_PREFILLED=true" >> packages/twenty-docker/.env
|
|
echo "Docker compose build..."
|
|
cd packages/twenty-docker/
|
|
docker compose build
|
|
working-directory: ./
|
|
|
|
- name: Create Tunnel
|
|
id: expose-tunnel
|
|
uses: codetalkio/expose-tunnel@v1.5.0
|
|
with:
|
|
service: bore.pub
|
|
port: 3000
|
|
|
|
- name: Start services with correct SERVER_URL
|
|
run: |
|
|
cd packages/twenty-docker/
|
|
|
|
# Update the SERVER_URL with the tunnel URL
|
|
echo "Setting SERVER_URL to ${{ steps.expose-tunnel.outputs.tunnel-url }}"
|
|
sed -i '/SERVER_URL=/d' .env
|
|
echo "SERVER_URL=${{ steps.expose-tunnel.outputs.tunnel-url }}" >> .env
|
|
|
|
# Start the services
|
|
echo "Docker compose up..."
|
|
docker compose up -d || {
|
|
echo "Docker compose failed to start"
|
|
docker compose logs
|
|
exit 1
|
|
}
|
|
|
|
echo "Waiting for services to be ready..."
|
|
count=0
|
|
while [ ! $(docker inspect --format='{{.State.Health.Status}}' twenty-db-1) = "healthy" ] || [ ! $(docker inspect --format='{{.State.Health.Status}}' twenty-server-1) = "healthy" ]; do
|
|
sleep 5
|
|
count=$((count+1))
|
|
if [ $count -gt 60 ]; then
|
|
echo "Timeout waiting for services to be ready"
|
|
docker compose logs
|
|
exit 1
|
|
fi
|
|
echo "Still waiting for services... ($count/60)"
|
|
done
|
|
|
|
echo "All services are up and running!"
|
|
working-directory: ./
|
|
|
|
- name: Seed Dev Workspace
|
|
run: |
|
|
cd packages/twenty-docker/
|
|
echo "Seeding full dev workspace..."
|
|
if ! docker compose exec -T server yarn command:prod -- workspace:seed:dev; then
|
|
echo "❌ Seeding full dev workspace failed. Dumping server logs..."
|
|
docker compose logs server
|
|
exit 1
|
|
fi
|
|
working-directory: ./
|
|
|
|
- name: Output tunnel URL to logs
|
|
run: |
|
|
echo "✅ Preview Environment Ready!"
|
|
echo "🔗 Preview URL: ${{ steps.expose-tunnel.outputs.tunnel-url }}"
|
|
echo "⏱️ This environment will be available for 5 hours"
|
|
|
|
- name: Post comment on PR
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
|
script: |
|
|
const COMMENT_MARKER = '<!-- PR_PREVIEW_ENV -->';
|
|
const commentBody = `${COMMENT_MARKER}
|
|
🚀 **Preview Environment Ready!**
|
|
|
|
Your preview environment is available at: ${{ steps.expose-tunnel.outputs.tunnel-url }}
|
|
|
|
This environment will automatically shut down when the PR is closed or after 5 hours.`;
|
|
|
|
// Get all comments
|
|
const {data: comments} = await github.rest.issues.listComments({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: ${{ github.event.client_payload.pr_number }},
|
|
});
|
|
|
|
// Find our comment
|
|
const botComment = comments.find(comment => comment.body.includes(COMMENT_MARKER));
|
|
|
|
if (botComment) {
|
|
// Update existing comment
|
|
await github.rest.issues.updateComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
comment_id: botComment.id,
|
|
body: commentBody
|
|
});
|
|
console.log('Updated existing comment');
|
|
} else {
|
|
// Create new comment
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: ${{ github.event.client_payload.pr_number }},
|
|
body: commentBody
|
|
});
|
|
console.log('Created new comment');
|
|
}
|
|
|
|
- name: Keep tunnel alive for 5 hours
|
|
run: timeout 300m sleep 18000 # Stop on whichever we reach first (300m or 5hour sleep)
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: |
|
|
cd packages/twenty-docker/
|
|
docker compose down -v
|
|
working-directory: ./
|