feat: Add PayPal configuration to settings
Introduces the ability to configure PayPal credentials for individual condos within the settings. This feature is only visible if PayPal is enabled in the global settings. Also removes and simplifies Dockerfile configurations.
This commit is contained in:
BIN
.dockerignore
BIN
.dockerignore
Binary file not shown.
15
Dockerfile
15
Dockerfile
@@ -1,15 +0,0 @@
|
|||||||
# Stage 1: Build Frontend
|
|
||||||
FROM node:18-alpine as build
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm install
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Serve with Nginx
|
|
||||||
FROM nginx:alpine
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
# Copy the nginx configuration file (using the .txt extension as provided in source)
|
|
||||||
COPY nginx.txt /etc/nginx/nginx.conf
|
|
||||||
EXPOSE 80
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
|||||||
38
nginx.conf
38
nginx.conf
@@ -1,38 +0,0 @@
|
|||||||
worker_processes 1;
|
|
||||||
|
|
||||||
events { worker_connections 1024; }
|
|
||||||
|
|
||||||
http {
|
|
||||||
include mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
sendfile on;
|
|
||||||
keepalive_timeout 65;
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
# Limite upload per allegati (es. foto/video ticket) - Allineato con il backend
|
|
||||||
client_max_body_size 50M;
|
|
||||||
|
|
||||||
# Compressione Gzip
|
|
||||||
gzip on;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
|
|
||||||
# Gestione SPA (React Router)
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Proxy API verso il backend
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://backend:3001;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection 'upgrade';
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_cache_bypass $http_upgrade;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -689,6 +689,26 @@ export const SettingsPage: React.FC = () => {
|
|||||||
<textarea value={activeCondo.notes || ''} onChange={(e) => setActiveCondo({ ...activeCondo, notes: e.target.value })} className="w-full border p-2.5 rounded-lg text-slate-700 h-24"></textarea>
|
<textarea value={activeCondo.notes || ''} onChange={(e) => setActiveCondo({ ...activeCondo, notes: e.target.value })} className="w-full border p-2.5 rounded-lg text-slate-700 h-24"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* PayPal Configuration for Single Condo Mode */}
|
||||||
|
{globalSettings?.features.payPal && (
|
||||||
|
<div className="bg-blue-50 p-4 rounded-lg border border-blue-100">
|
||||||
|
<div className="flex items-center gap-2 mb-2 text-blue-800">
|
||||||
|
<CreditCard className="w-4 h-4"/>
|
||||||
|
<span className="text-xs font-bold uppercase">Configurazione Pagamenti</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="text-xs font-semibold text-slate-600 block mb-1">PayPal Client ID</label>
|
||||||
|
<input
|
||||||
|
className="w-full border p-2 rounded text-slate-700 text-sm"
|
||||||
|
placeholder="Es: Afg... (Ottienilo da developer.paypal.com)"
|
||||||
|
value={activeCondo.paypalClientId || ''}
|
||||||
|
onChange={e => setActiveCondo({...activeCondo, paypalClientId: e.target.value})}
|
||||||
|
/>
|
||||||
|
<p className="text-[10px] text-slate-500 mt-1">Necessario per abilitare i pagamenti online delle rate.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-slate-700 mb-1">Quota Mensile Standard (€)</label>
|
<label className="block text-sm font-medium text-slate-700 mb-1">Quota Mensile Standard (€)</label>
|
||||||
<input type="number" value={activeCondo.defaultMonthlyQuota} onChange={(e) => setActiveCondo({ ...activeCondo, defaultMonthlyQuota: parseFloat(e.target.value) })} className="w-full border p-2.5 rounded-lg text-slate-700" placeholder="Quota Default" required />
|
<input type="number" value={activeCondo.defaultMonthlyQuota} onChange={(e) => setActiveCondo({ ...activeCondo, defaultMonthlyQuota: parseFloat(e.target.value) })} className="w-full border p-2.5 rounded-lg text-slate-700" placeholder="Quota Default" required />
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM node:18-alpine
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Set production environment
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm install --production
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
EXPOSE 3001
|
|
||||||
CMD ["node", "server.js"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user