Skip to content

Commit

Permalink
Catch up from main (#551)
Browse files Browse the repository at this point in the history
* Bake in the github short sha as the container's release version. (#531)

* Bake in the github short sha as the container's release version.

* changed github_sha syntax for consistency within the file

---------

Co-authored-by: Jo <[email protected]>

* Bugs/517 ftue qa (#532)

* Don't overwrite app theme, just remove the dark class from html.

* * Require one weekday to be selected
* Adjust styling of notice bar
* Dynamically show warnings on notice bar
* Add missing chip

* Remove hardcoded cert (#533)

* converted ssl cert to a variable

* update ssl cert in validate workflow

* corrected ssl cert variable reference (#534)

* added env variable declaration (#535)

* Replace yarn with npm (#537)

* Replace yarn with npm

* Fix validation workflow

* Oops, also swap yarn here.

* Add package lock

* Waiting List Admin Panel (Readonly) (#536)

* Add initial waiting list admin panel.

Read-only for now, with some filters.

* Add tests

* 🌐 Update German translation

* Adjust script tag and remove console log

---------

Co-authored-by: Andreas Müller <[email protected]>

* added recursive flag to frontend zip command (#539)

* Add another except for any OAuth2Errors (#540)

* Schedule booking confirmation (#519)

* ➕ Add schedule booking confirmation

* ➕ Enhance schedule API to handle bookings without confirmation

* 🔨 Show proper success message depending on confirmation status

* 🔨 Make field nullable and fix fn return

* 🌐 Update frontend/src/locales/en.json

Co-authored-by: Mel <[email protected]>

* 🌐 Update German translation

* 🔨 Assume appointment mustn't be null

---------

Co-authored-by: Mel <[email protected]>

* Add types for utils (#520)

* Configuration to fix HMR (#527)

* ➕ Add configuration to fix HMR

* 🔨 Make polling optional by env var

* 🔨 Fix merge config

* 🔨 Only use necessary options

* Update English heading cases (#548)

* Use server_default for migrations, and fix a logic error from my suggestion (#549)

---------

Co-authored-by: Mel <[email protected]>
Co-authored-by: Jo <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent e96cb2d commit 605897b
Show file tree
Hide file tree
Showing 47 changed files with 9,132 additions and 4,661 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
TF_VAR_zoom_secret: ${{ vars.zoom_secret }}
TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}

steps:
- name: Get Artifact from Release
Expand Down Expand Up @@ -169,6 +170,7 @@ jobs:
TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
TF_VAR_zoom_secret: ${{ vars.zoom_secret }}
TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}

steps:
- name: Get IaC from Release
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
TF_VAR_environment: ${{ vars.ENV_SHORT_NAME }}
TF_VAR_name_prefix: "tb-${{ vars.PROJECT_SHORT_NAME }}-${{ vars.ENV_SHORT_NAME }}"
TF_VAR_frontend_url: ${{ vars.FRONTEND_URL }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -132,6 +133,7 @@ jobs:
TF_VAR_environment: ${{ vars.ENV_SHORT_NAME }}
TF_VAR_name_prefix: "tb-${{ vars.PROJECT_SHORT_NAME }}-${{ vars.ENV_SHORT_NAME }}"
TF_VAR_frontend_url: ${{ vars.FRONTEND_URL }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}

steps:
- uses: actions/checkout@v4
Expand All @@ -142,12 +144,12 @@ jobs:
node-version: '20.x'

- name: Install dependencies
run: cd frontend && yarn install
run: cd frontend && npm install

- name: Build stage frontend
run: |
cp frontend/.env.stage.example frontend/.env.stage
cd frontend && yarn build --mode ${{ vars.APP_ENV }}
cd frontend && npm run build -- --mode ${{ vars.APP_ENV }}
- name: install opentofu
uses: opentofu/setup-opentofu@v1
Expand Down Expand Up @@ -212,11 +214,12 @@ jobs:
id: build-backend
env:
ECR_TAG: '${{ steps.login-ecr.outputs.registry }}/${{ vars.PROJECT }}:backend-${{ github.sha }}'
RELEASE_VERSION: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_TAG ./backend -f ./backend/deploy.dockerfile
docker build --build-arg "RELEASE_VERSION=$RELEASE_VERSION" -t $ECR_TAG ./backend -f ./backend/deploy.dockerfile
docker push $ECR_TAG
echo "image_backend=$ECR_TAG" >> $GITHUB_OUTPUT
echo $ECR_TAG > ecr_tag.txt
Expand Down Expand Up @@ -254,6 +257,7 @@ jobs:
TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
TF_VAR_zoom_secret: ${{ vars.ZOOM_SECRET }}
TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -320,13 +324,13 @@ jobs:
node-version: '20.x'

- name: Install dependencies
run: cd frontend && yarn install
run: cd frontend && npm install

- name: Build prod frontend
run: |
cp frontend/.env.prod.example frontend/.env.prod
cd frontend && yarn build --mode ${{ vars.APP_ENV }}
zip ../frontend.zip dist
cd frontend && npm run build -- --mode ${{ vars.APP_ENV }}
zip -r ../frontend.zip dist
- name: download ecr tag
uses: actions/download-artifact@v4
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
TF_VAR_zoom_secret: ${{ vars.zoom_secret }}
TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
TF_VAR_ssl_cert_arn: ${{ vars.SSL_CERT_ARN }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -158,14 +159,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: 'frontend/yarn.lock'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'

- name: Install dependencies
run: |
cd ./frontend
yarn install
npm install
- name: Test with vitest
run: |
cd ./frontend && yarn test --run
cd ./frontend && npm run test -- --run
2 changes: 2 additions & 0 deletions backend/deploy.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ RUN pip install .'[deploy]'
RUN mkdir src
RUN ln -s /app/appointment src/appointment

ARG RELEASE_VERSION
ENV RELEASE_VERSION=$RELEASE_VERSION

EXPOSE 5000
CMD ["/bin/sh", "./scripts/entry.sh"]
1 change: 1 addition & 0 deletions backend/src/appointment/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class Schedule(Base):
farthest_booking: int = Column(Integer, default=20160) # in minutes, defaults to 2 weeks
weekdays: str | dict = Column(JSON, default='[1,2,3,4,5]') # list of ISO weekdays, Mo-Su => 1-7
slot_duration: int = Column(Integer, default=30) # defaults to 30 minutes
booking_confirmation: bool = Column(Boolean, index=True, nullable=False, default=True)

# What (if any) meeting link will we generate once the meeting is booked
meeting_link_provider: MeetingLinkProviderType = Column(
Expand Down
18 changes: 17 additions & 1 deletion backend/src/appointment/database/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class AppointmentOut(AppointmentBase):
owner_name: str | None = None
slots: list[SlotBase | SlotOut] = []
slot_duration: int
booking_confirmation: bool


""" SCHEDULE model schemas
Expand Down Expand Up @@ -167,9 +168,10 @@ class ScheduleBase(BaseModel):
end_time: time | None = None
earliest_booking: int | None = None
farthest_booking: int | None = None
weekdays: list[int] | None = [1, 2, 3, 4, 5]
weekdays: list[int] | None = Field(min_length=1, default=[1, 2, 3, 4, 5])
slot_duration: int | None = None
meeting_link_provider: MeetingLinkProviderType | None = MeetingLinkProviderType.none
booking_confirmation: bool = True

class Config:
json_encoders = {
Expand Down Expand Up @@ -398,3 +400,17 @@ class TokenForWaitingList(BaseModel):

class CheckEmail(BaseModel):
email: EmailStr = Field(title='Email', min_length=1)


class WaitingListAdminOut(BaseModel):
id: int
email: str
email_verified: bool
invite_id: int | None = None
time_created: datetime
time_updated: datetime

invite: Invite | None = None

class Config:
from_attributes = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""schedule booking confirmation
Revision ID: fb1feb76c467
Revises: 0c22678e25db
Create Date: 2024-07-04 15:01:47.090876
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy import true

# revision identifiers, used by Alembic.
revision = 'fb1feb76c467'
down_revision = '0c22678e25db'
branch_labels = None
depends_on = None


def upgrade() -> None:
op.add_column('schedules', sa.Column('booking_confirmation', sa.Boolean, nullable=False, server_default=true(), index=True))


def downgrade() -> None:
op.drop_column('schedules', 'booking_confirmation')
1 change: 1 addition & 0 deletions backend/src/appointment/routes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ def read_public_appointment(slug: str, db: Session = Depends(get_db)):
owner_name=s.name,
slots=slots,
slot_duration=slots[0].duration if len(slots) > 0 else 0,
booking_confirmation=False
)


Expand Down
Loading

0 comments on commit 605897b

Please sign in to comment.