Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,5 @@ npm-debug.log*
.idea
.DS_Store

# Frontend source (not needed — only public/ticket-widget.js is served)
src/
index.html
package.json
package-lock.json
# Frontend artifacts not needed in final image (but included for build stage)
.npmrc
tsconfig*.json
vite.config.ts
eslint.config.js
15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Stage 1: Backend
# Stage 1: Build the widget
FROM node:20-alpine AS build

WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Stage 2: Backend + Frontend
FROM node:20-alpine

# Install nginx to serve the static frontend
Expand All @@ -7,8 +16,8 @@ RUN apk add --no-cache nginx
# Copy nginx config
COPY nginx.conf /etc/nginx/nginx.conf

# Copy static frontend (ticket-widget.js)
COPY public/ /usr/share/nginx/html/
# Copy built widget from build stage
COPY --from=build /app/dist/ /usr/share/nginx/html/

# Setup backend
WORKDIR /app/server
Expand Down
541 changes: 0 additions & 541 deletions public/production/ticket-widget.js

This file was deleted.

4 changes: 2 additions & 2 deletions public/ticket-widget.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ function ensureMounted() {
const mountPoint = document.createElement("div");
shadowRoot.appendChild(mountPoint);

// Stop keyboard events from propagating to the host app so its global
// shortcut listeners (e.g. "g h" → Go Home) don't fire while the user
// is typing inside the widget (DS-1707).
(["keydown", "keyup", "keypress"] as const).forEach((eventType) => {
container!.addEventListener(eventType, (e) => e.stopPropagation(), true);
});

document.body.appendChild(container);

root = ReactDOM.createRoot(mountPoint);
Expand Down